Inkscape can't find the lxml Python module (MacOS)

Post questions on how to use or achieve an effect in Inkscape.
BobDowling
Posts: 2
Joined: Sat Dec 27, 2008 9:20 pm

Inkscape can't find the lxml Python module (MacOS)

Postby BobDowling » Sun Dec 27, 2009 2:33 am

Version of Inkscape: 0.47
Platform: MacOS 10.6.2

When I try to run Extensions -> Generate from path -> Pattern from path I get an error message:
"The fantastic lxml wrapper for libxml2 is required by inkex.py and therefore this extension. ..."

But I do have the lxml Python module installed:

> python
Python 2.6.1 (r261:67515, Jul 7 2009, 23:51:51)
[GCC 4.2.1 (Apple Inc. build 5646)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import lxml
>>> help(lxml)

Help on package lxml:
NAME
lxml - # this is a package
FILE
/Library/Python/2.6/site-packages/lxml/__init__.py


What am I missing?

~suv
Posts: 2272
Joined: Sun May 10, 2009 2:07 am

Re: Inkscape can't find the lxml Python module (MacOS)

Postby ~suv » Sun Dec 27, 2009 4:28 am

Do you use the bundled Inkscape 0.47 from sf.net? This package has both required Python modules 'lxml' and 'numpy' included and loads them first if $PYTHONPATH in the launcher script is unchanged. Unfortunately there's an up-to-now unresolved issue with those bundled modules and the default python binary installed on OS X Snow Leopard:

Bug #482993 in Inkscape: “Inkscape extensions do not work on MacOS X 10.6 (Snow Leopard)

what you could try:
  1. rename the folder 'python' inside the Inkscape application bundle (Inkscape.app/Contents/Resources/python) so that other modules are searched and used
  2. if above solution doesn't help you might need to edit $PYTHONPATH in the launcher script (Inkscape.app/Contents/Resources/bin/inkscape) if you know how to configure python to find the correct modules.

Note to other Inkscape users on OS X Snow Leopard who happen to read this because it turned up in a google or forum search: this is not a general tip or recommendation but applies only if you have all needed modules already installed outside of the Inkscape application bundle! You should not modify any files inside the application bundle because it can break stuff and prevent Inkscape from launching at all.

ivan.alvarado
Posts: 2
Joined: Tue Feb 02, 2010 2:29 am

unresolved

Postby ivan.alvarado » Tue Feb 02, 2010 3:35 am

:cry: :cry: :cry:
I return to the topic because I have no solution

This is error:
Image
Inkscape version:
Image
and OS:
Image

please if anyone knows of any solution. :roll:

~suv
Posts: 2272
Joined: Sun May 10, 2009 2:07 am

Re: Inkscape can't find the lxml Python module (MacOS)

Postby ~suv » Tue Feb 02, 2010 3:47 am

ivan.alvarado wrote:please if anyone knows of any solution

To my knowledge this is not yet solved… There have been some workarounds reported, but not yet a definitive solution:
Bug #482993 in Inkscape: “Inkscape extensions do not work on MacOS X 10.6 (Snow Leopard)
InkscapeForum.com • Topic • Inkscape and OS X 10.6 Snow Leopard

inkist

Re: Inkscape can't find the lxml Python module (MacOS)

Postby inkist » Sun May 30, 2010 9:26 pm

I just had the same problem.
Issuing "easy-install lxml" and "easy-install numpy" in a terminal placed the modules in a place where python does now find them.
The $PYTHONPATH-thing is set to a proper value in the startup script ".../bin/inkscape", it seems however that it gets ignored or is not properly passed to the processing instance of the interpreter.

I can imagine that two symlinks would do the same trick, but it would be a rather dirty "solution".


Return to “Help with using Inkscape”