Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
glsa-check: ImportError: No module named pyexpat
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
hexa
Apprentice
Apprentice


Joined: 10 Aug 2005
Posts: 163

PostPosted: Tue Jul 22, 2008 11:00 am    Post subject: glsa-check: ImportError: No module named pyexpat Reply with quote

Hi,

i decided to upgrade python on one of my servers from 2.4 to 2.5. After the upgrade glsa-check -l fails with:
Code:

spike ~ # glsa-check -l     
[A] means this GLSA was already applied,
[U] means the system is not affected and
[N] indicates that the system might be affected.

Traceback (most recent call last):
  File "/usr/bin/glsa-check", line 206, in <module>
    sys.exit(summarylist(glsalist))
  File "/usr/bin/glsa-check", line 172, in summarylist
    myglsa = Glsa(myid, glsaconfig)
  File "/usr/lib/gentoolkit/pym/glsa.py", line 414, in __init__
    self.read()
  File "/usr/lib/gentoolkit/pym/glsa.py", line 432, in read
    self.parse(urllib.urlopen(myurl))
  File "/usr/lib/gentoolkit/pym/glsa.py", line 446, in parse
    self.DOM = xml.dom.minidom.parse(myfile)
  File "/usr/lib/python2.5/xml/dom/minidom.py", line 1912, in parse
    from xml.dom import expatbuilder
  File "/usr/lib/python2.5/xml/dom/expatbuilder.py", line 32, in <module>
    from xml.parsers import expat
  File "/usr/lib/python2.5/xml/parsers/expat.py", line 4, in <module>
    from pyexpat import *
ImportError: No module named pyexpat
spike ~ #


So i tried python-updater, recompiling expat version 2. and 1., removing python from old slot, recompiling gentookit,...

Nothing seems to help with this problem. What else can I do?
Let me know if you need more info. Thank you for your time.
Back to top
View user's profile Send private message
AllenJB
Veteran
Veteran


Joined: 02 Sep 2005
Posts: 1285

PostPosted: Tue Jul 22, 2008 12:14 pm    Post subject: Reply with quote

According to my system, the file is provided by python itself, and I can't see any USE flags relating to xml.

I would avoid any switching between expat 1 and 2 because of the ABI breakage expat causes. You should be sticking to the stabl version 2 now.

My python 2.5 USE flags are: berkdb gdbm ipv6 ncurses readline sqlite ssl threads -bootstrap -build -doc -examples -tk -ucs2 -wininst

I would check your USE flags against those - particularly ensure that you don't have bootstrap or build enabled (these 2 flags should never be enabled by users). Then try re-emerging python 2.5
Back to top
View user's profile Send private message
hexa
Apprentice
Apprentice


Joined: 10 Aug 2005
Posts: 163

PostPosted: Tue Jul 22, 2008 12:56 pm    Post subject: Reply with quote

Hi,

I'm on expat 1. I tried installing expat 2 just to make sure using version 1 isn't a problem. The error persisted.
I also did reemerge of python 2.5, but the problem is exactly the same.
Code:

spike ~ # emerge python -av

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild   R   ] dev-lang/python-2.5.2-r5  USE="berkdb gdbm ncurses readline ssl threads -bootstrap -build -doc -examples -ipv6 -sqlite -tk -ucs2 -wininst" 0 kB

Total: 1 package (1 reinstall), Size of downloads: 0 kB

Would you like to merge these packages? [Yes/No] yes
>>> Verifying ebuild Manifests...

>>> Emerging (1 of 1) dev-lang/python-2.5.2-r5 to /
 * python-gentoo-patches-2.5.2-r5.tar.bz2 RMD160 SHA1 SHA256 size ;-) ...                                                                                                                         [ ok ]
 * Python-2.5.2.tar.bz2 RMD160 SHA1 SHA256 size ;-) ...                                                                                                                                           [ ok ]
 * checking ebuild checksums ;-) ...                                                                                                                                                              [ ok ]
 * checking auxfile checksums ;-) ...                                                                                                                                                             [ ok ]
 * checking miscfile checksums ;-) ...                                                                                                                                                            [ ok ]
 * checking Python-2.5.2.tar.bz2 ;-) ...                                                                                                                                                          [ ok ]
 * checking python-gentoo-patches-2.5.2-r5.tar.bz2 ;-) ...                                                                                                                                        [ ok ]
>>> Unpacking source...
>>> Unpacking Python-2.5.2.tar.bz2 to /var/tmp/portage/dev-lang/python-2.5.2-r5/work
...
...
...
* Your original Python is still installed and can be accessed via
 * /usr/bin/python2.x.
 *
 * GNU info directory index is up-to-date.
spike ~ # glsa-check -l
[A] means this GLSA was already applied,
[U] means the system is not affected and
[N] indicates that the system might be affected.

Traceback (most recent call last):
  File "/usr/bin/glsa-check", line 206, in <module>
    sys.exit(summarylist(glsalist))
  File "/usr/bin/glsa-check", line 172, in summarylist
    myglsa = Glsa(myid, glsaconfig)
  File "/usr/lib/gentoolkit/pym/glsa.py", line 414, in __init__
    self.read()
  File "/usr/lib/gentoolkit/pym/glsa.py", line 432, in read
    self.parse(urllib.urlopen(myurl))
  File "/usr/lib/gentoolkit/pym/glsa.py", line 446, in parse
    self.DOM = xml.dom.minidom.parse(myfile)
  File "/usr/lib/python2.5/xml/dom/minidom.py", line 1912, in parse
    from xml.dom import expatbuilder
  File "/usr/lib/python2.5/xml/dom/expatbuilder.py", line 32, in <module>
    from xml.parsers import expat
  File "/usr/lib/python2.5/xml/parsers/expat.py", line 4, in <module>
    from pyexpat import *
ImportError: No module named pyexpat
spike ~ # find / -name expat.py
/usr/lib/python2.5/xml/parsers/expat.py
spike ~ # equery l expat
[ Searching for package 'expat' in all categories among: ]
 * installed packages
[I--] [  ] dev-libs/expat-1.95.8 (0)
Back to top
View user's profile Send private message
doro1211
Guru
Guru


Joined: 06 Jun 2004
Posts: 312

PostPosted: Tue Jul 22, 2008 6:26 pm    Post subject: Reply with quote

Use eselect-python and set python to 2.5 (might have to emerge eselect-python)
Run python-updater
Run revdep-rebuild -X -i
emerge --oneshot libxml2 libexpat
revdep-rebuild -X -i again

is what I'd probably try.
Back to top
View user's profile Send private message
mikegpitt
Advocate
Advocate


Joined: 22 May 2004
Posts: 3224

PostPosted: Sun Aug 03, 2008 4:56 pm    Post subject: Reply with quote

Having the same issue here. I've run a revdep-rebuild and it didn't pick up anything. I also reemerged libxml2 and =expat-1.95.8 but glsa-check still bombs out:

Code:
# glsa-check --list affected
Traceback (most recent call last):
  File "/usr/bin/glsa-check", line 148, in <module>
    myglsa = Glsa(x, glsaconfig)
  File "/usr/lib/gentoolkit/pym/glsa.py", line 414, in __init__
    self.read()
  File "/usr/lib/gentoolkit/pym/glsa.py", line 432, in read
    self.parse(urllib.urlopen(myurl))
  File "/usr/lib/gentoolkit/pym/glsa.py", line 446, in parse
    self.DOM = xml.dom.minidom.parse(myfile)
  File "/usr/lib/python2.5/xml/dom/minidom.py", line 1912, in parse
    from xml.dom import expatbuilder
  File "/usr/lib/python2.5/xml/dom/expatbuilder.py", line 32, in <module>
    from xml.parsers import expat
  File "/usr/lib/python2.5/xml/parsers/expat.py", line 4, in <module>
    from pyexpat import *
ImportError: No module named pyexpat
Back to top
View user's profile Send private message
mikegpitt
Advocate
Advocate


Joined: 22 May 2004
Posts: 3224

PostPosted: Mon Aug 04, 2008 5:20 pm    Post subject: Reply with quote

I also tried the upgrade to expat-2.x, and it didn't solve anything.
Back to top
View user's profile Send private message
mikegpitt
Advocate
Advocate


Joined: 22 May 2004
Posts: 3224

PostPosted: Mon Aug 04, 2008 6:57 pm    Post subject: Reply with quote

I think I solved things. It looks like there is a missing dependency for pyxml. Emerge dev-python/pyxml and the error goes away.
Back to top
View user's profile Send private message
hexa
Apprentice
Apprentice


Joined: 10 Aug 2005
Posts: 163

PostPosted: Tue Aug 05, 2008 7:44 am    Post subject: Reply with quote

LOL!
I gave up in this for now. I guess you solved my problems. :-) Sometimes is best to wait.
Thanx.

Also make a bug report for missing dependency. :-)
Back to top
View user's profile Send private message
depontius
Advocate
Advocate


Joined: 05 May 2004
Posts: 3509

PostPosted: Sun Feb 22, 2009 11:29 am    Post subject: Reply with quote

I've been running glsa-check in cron.daily for years, and just got bit by this, this morning. Yesterday I did a general update, so that's probably what broke it, but gentoolkit wasn't one of the packages I updated. This morning I found that pyxml was not installed on that system, and installing it appears to have fixed the problem.

Any idea of what happened?
_________________
.sigs waste space and bandwidth
Back to top
View user's profile Send private message
Genone
Retired Dev
Retired Dev


Joined: 14 Mar 2003
Posts: 9530
Location: beyond the rim

PostPosted: Sun Feb 22, 2009 1:47 pm    Post subject: Reply with quote

The "usual" problems between the standard python xml modules and pyxml (sometimes pyxml solves the problems, sometimes it creates them) that have existed for years.
Back to top
View user's profile Send private message
hexa
Apprentice
Apprentice


Joined: 10 Aug 2005
Posts: 163

PostPosted: Tue Mar 24, 2009 9:03 am    Post subject: Reply with quote

Someone should really fix this dependency.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum