Skip to content

ImportError: No module named pyexpat #5

Closed
arturolinares opened this Issue Mar 22, 2012 · 21 comments

9 participants

@arturolinares

I'm getting this error in the console when the xdebug connection is stablished:

``` ('127.0.0.1', 55656)
Traceback (most recent call last):
File "./Xdebug.py", line 273, in gui_callback
init = protocol.read().firstChild
File "./Xdebug.py", line 78, in read
document = parseString(data)
File ".\xml\dom\minidom.py", line 1927, in parseString
File ".\xml\dom\expatbuilder.py", line 32, in
File ".\xml\parsers\expat.py", line 4, in
ImportError: No module named pyexpat

@Kindari
Owner
Kindari commented Mar 22, 2012

Operating System?

@arturolinares
@Kindari
Owner
Kindari commented Mar 22, 2012

clemos/haxe-sublime-bundle#17

Looks like a similar problem is in this thread. I will keep investigating. Could you provide the following?

Distribution / version

python --version

in sublime console:
import sys
print sys.version

@mavimo
mavimo commented Mar 22, 2012

same error here:

import sys
print sys.version

2.6.6 (r266:84292, Jun 16 2011, 22:27:44) 
[GCC 4.4.5]
@mavimo
mavimo commented Mar 22, 2012

Ok, I find a solution. On ubuntu 10.10 there are some python libraries on:

/usr/lib/python2.6/lib-dynload/

so, open console and write:

import sys
sys.path.append("/usr/lib/python2.6/lib-dynload/")

now problem desappair :)

@arturolinares

Ubuntu 11.10

$ python --version
Python 2.7.2+

Sublime console:

>>> import sys
>>> print sys.version
2.6.6 (r266:84292, Jun 16 2011, 22:27:44) 
[GCC 4.4.5]
@arturolinares

Right, solved it with mavimo instructions and installing python:

$ sudo apt-get install python2.6

What should happen when selecting Status in the debugger menu?

@Kindari
Owner
Kindari commented Mar 22, 2012

I just fixed an issue in that, so repull before trying again, but it tells you what status the debugger is in. It places the message in the status bar, it will only be there for about 5 seconds. usually in the form of "ok: starting" or "ok: stopping"

Glad your issue was resolved.

@arturolinares

Sweet! thanks a lot.

@Kindari
Owner
Kindari commented Mar 22, 2012

If you completely restart ST2, do you have to append that path to sys.path again? If so I can see that being a pain.

@arturolinares

Yes. I just saw in the forums it enough to add a symlink to avoid that. I'll update the docs.

@BogdanBartis

I'm having the same problem, unfortunatelly after the path append I get another error:

ImportError: /usr/lib/python2.7/lib-dynload/pyexpat.so: undefined symbol: PyCapsule_New

I've tried searching for a solution but to no avail.

Ubuntu 12.04

$ python --version
Python 2.7.3
>>> import sys
>>> print sys.version
2.6.6 (r266:84292, Jun 16 2011, 22:35:51) 
[GCC 4.4.5]

Any help would be appreciated. Thanks

@kaainet
kaainet commented Jun 7, 2012

I'm having the same problem as helixdev

@jotson
Collaborator
jotson commented Jun 7, 2012

Have you guys tried the new instructions re: python 2.6 and pyexpat in the README? In the Troubleshooting section.

@kaainet
kaainet commented Jun 8, 2012

It helps. Thanks a lot!

@ElijahLynn

The readme text fixes this, one question though, there is a python26.zip file in the directory by default. What is that for? /usr/lib/sublime-text-2/lib/python2/python26.zip

@themroc5

i guess its being used from sublime itself...

@paulollivier paulollivier referenced this issue in facelessuser/ExportHtml Feb 22, 2013
Closed

pyexpat import fails #5

@temple
temple commented Nov 12, 2013

I'm still having initiall issue.

On bash

$ pwd
> /usr/lib/python2.7/lib-dynload

$ ls *expat*
> pyexpat.so

On Sublime

>>> import sys
>>> sys.path.append("/usr/lib/python2.7/lib-dynload/")

Can it only run with python 2.6?

@temple
temple commented Nov 12, 2013

@jotson which README are you exactly referring to?

@jotson
Collaborator
jotson commented Nov 12, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.