Sublime Forum

MINIDOM issues

#1

Hey guys,

Not sure why this is happening, but when I try to import xml.dom.minidom and call parseString() on it it fails as such…

from pyexpat import *

ImportError: No module named pyexpat

Looks like it needs an XML parser?
works find in my python2.6 console. I even tried sym-linking it to sublimes python directory! No Dice
Not sure whats up with that.

I just need to parse some XML sublime! Jeez! :wink:

Any help would be greatly appreciated… Doing a big project for you PHP developers out there :smile:

Running Sublime Text 2 Build 2139 on Ubuntu 11.10

0 Likes

#2

And how to fix it for Linux?

Any ideas?

Interesting package github.com/a-sk/sublime-css-colors also generates this error. :cry:

0 Likes

#3

If it is not bundled with the version of Python that is included with Sublime, you could always bundle it with your plugin. The only complication would be if it is not pure python, then you would need to figure out how to handle the different platforms. I believe SublimeCodeIntel has figured out how to handle native code for the various platforms, so you may want to look there.

I had to do something similar with the SFTP plugin because the version of ftplib in 2.6 doesn’t appear to respect timeouts after the connection phase, which lead to issues trying to gracefully handle incorrect passive/active settings. I bundled a custom version of ftplib which I renamed to prevent conflicts with other plugins.

0 Likes

#4

in my ubuntu with default python 2.7 for some packages I did next trick:

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

/usr/lib/python2.6/lib-dynload - in that folder is pyexpat on the local machine.

0 Likes