You are here

Inkscape bug - missing lxml

8 posts / 0 new
Last post
Laur
Offline
Last seen: 12 years 8 months ago
Joined: 2011-04-26 10:55
Inkscape bug - missing lxml

While using Inkscape Portable, I tried to save the file as a .dxf and encountered the following error message:

The fantastic lxml wrapper for libxml2 is required by inkex.py and therefore this extension. Please download and install the latest version from http://cheeseshop.python.org/pypi/lxml/, or install it through your package manager by a command like: sudo apt-get install python-lxml

I assume that this would also affect other effects that rely on lxml.

John T. Haller
John T. Haller's picture
Offline
Last seen: 15 hours 11 min ago
AdminDeveloperModeratorTranslator
Joined: 2005-11-28 22:21
Don't Know

I don't know the answer to this offhand as we include everything in Inkscape Portable that's in the Inkscape windows builds. It looks like it is not included by default and you have to manually add it, but I see no instructions for doing this in relation to Inkscape locally. Anyone else have any ideas? Have you asked over at Inkscape.org?

Sometimes, the impossible can become possible, if you're awesome!

Laur
Offline
Last seen: 12 years 8 months ago
Joined: 2011-04-26 10:55
No, I haven't asked over at

No, I haven't asked over at Inkscape.org yet, as I haven't confirmed that this problem exists with the standard Inkscape windows install. I don't use Inkscape on Windows except in portable form.

I went to the link in the error message and found that lxml is available as a python egg, but I have no idea how to install it locally. InkscpaePortable seems to come with its own version of python in App\Inkscape\python, so I would guess it would go somewhere in there. Do regular Inkscape Windows builds come with python included as well?

Chris Morgan
Chris Morgan's picture
Offline
Last seen: 9 years 6 months ago
Joined: 2007-04-15 21:08
Intended to be there

I don't have this handy, but a quick check in the inkscape-devlibs repository shows that lxml is included - see http://bazaar.launchpad.net/~inkscape.dev/inkscape-devlibs/trunk/files/h.... There should be a directory App\Inkscape\python\Lib\site-packages\lxml with those files in. Is it there? If it is, it should be working. (Very few extensions in Inkscape would work without this, so they would have had many bug reports if it weren't working in the local version.) I'm not sure quite what's going on. You check that, then I'll check out the rest some time soon.

I am a Christian and a developer and moderator here.

“A soft answer turns away wrath, but a harsh word stirs up anger.” – Proverbs 15:1

Laur
Offline
Last seen: 12 years 8 months ago
Joined: 2011-04-26 10:55
Yup, it's there

Sure enough, lxml is exactly where you said it would be! So I assume the problem is that for some reason the dxf exporter can't find it.

Chris Morgan
Chris Morgan's picture
Offline
Last seen: 9 years 6 months ago
Joined: 2007-04-15 21:08
Need to check more

I'll need to investigate this some more and work out whether this is happening in Inkscape itself for this particular case, or whether it's to do with the way the portable version is run, or the compression used in the portable version.

I am a Christian and a developer and moderator here.

“A soft answer turns away wrath, but a harsh word stirs up anger.” – Proverbs 15:1

Laur
Offline
Last seen: 12 years 8 months ago
Joined: 2011-04-26 10:55
I figured out what the issue

I figured out what the issue is, apparently this computer has several other versions of python installed. There is another version in my PATH, plus the PYTHONHOME and PYTHONPATH environment variables are set and pointing somewhere else. After some experimentation it appears that the PYTHONHOME variable is the key one. I changed this to the App/Inkscape/python directory under the InkscapePortable install, I left the PATH and PYTHONPATH alone, and the extensions worked fine.

Is it possible to modify InkscapePortable so that it ignores this variable and always looks in its own path for python?

John T. Haller
John T. Haller's picture
Offline
Last seen: 15 hours 11 min ago
AdminDeveloperModeratorTranslator
Joined: 2005-11-28 22:21
Next Release

I've made a note to ensure this is added to the next release. For now, you can edit the InkscapePortable.ini file within the App\AppInfo\Launcher directory and add PYTHONHOME=%PAL:AppDir%\Inkscape\python to the end of the [Environment] section. Then you don't need to set a PYTHONHOME system-wide and it will work as you move PCs.

Sometimes, the impossible can become possible, if you're awesome!

Log in or register to post comments