python extensions fail on win32

Bug #178022 reported by theAdib
4
Affects Status Importance Assigned to Milestone
Inkscape
Fix Released
High
ishmal

Bug Description

Most of the python extensions are based on lxml in order to parse svg.
As we deliver python interpreter on win32 systems we MUST deliver this extension as well in order to get most extensions running 80/20 rule.

error message:
The fantabulous lxml wrapper for libxml2 is required by inkex_lxml.py and
therefore this extension. Please download the latest version from
<http://cheeseshop.python.org/pypi/lxml/>.

Changed in inkscape:
importance: Undecided → High
milestone: none → 0.46
status: New → Confirmed
Bryce Harrington (bryce)
Changed in inkscape:
assignee: nobody → ishmalius
Revision history for this message
rockstar1707 (rockstar1707-gmail) wrote :

The extensions which need lxml, don't work with 0.46.pre1-4.win32.

However, they do work with the build "Inkscape0802041831.7z"

Revision history for this message
archis (archis) wrote :

As far as I can see, both the public beta on inkscape.org as well as the nightlies from ishmal's site have an older version of lxml, 1.3beta-py2.5 packaged with them, under path/to/inkscape/python/Lib/site-packages (on windows vista). However they are seemingly not being found when you try to run any command from the Effects menu, thus producing the error message above. I see the same issue on Windows Vista. A commenter on bug 187290 -- https://bugs.launchpad.net/inkscape/+bug/187290 -- (a duplicate?), wrote that the paths might not be set properly:

The downloaded Inkscape 0.46 does not seem to include an installer so I wrote a little .bat file to change the PATH before starting the program. The Effects then work because the python files are found.
runink.bat
set PATH="C:\directory\where\files\were\unzipped\inkscape\python";%PATH%;
set PYTHONPATH="C:\directory\where\files\were\unzipped\inkscape\python"
C:\directory\where\files\were\unzipped\inkscape\inkscape.exe

Addendum: I installed a new stable version of lxml (v2.0.1) into my existing Python 2.5.1 install, at /path/to/python/Lib/site-packages. Now I get a different error:

Traceback (most recent call last):

  File "share\extensions\embedimage.py", line 105, in <module>

    e.affect()

  File "C:\Users\..\path\to\inkscape\share\extensions\inkex.py", line 151, in affect

    self.getposinlayer()

  File "C:\Users\..\path\to\inkscape\share\extensions\inkex.py", line 119, in getposinlayer

    layerattr = self.document.xpath('//sodipodi:namedview/@inkscape:current-layer', NSS)

TypeError: function takes at most 1 positional arguments (2 given)

Hope this helps.

Revision history for this message
Aaron C Spike (acspike) wrote :

Is this a packaging bug? Well the error in the last comment about lxml 2.0.1 isn't. And that error should be fixed as of r17424. Please test.

Revision history for this message
archis (archis) wrote :

It works, Aaron! -- i.e. no more missing lxml warning nor the traceback when effects are invoked. Thanks for the heads-up.

Note: I don't compile myself on win32; I used the following win32 daily from ishmal's site..

http://inkscape.modevia.com/win32/Inkscape0802211541.7z

Revision history for this message
Bryce Harrington (bryce) wrote :

archis, thanks for confirming the bug is now fixed.

Changed in inkscape:
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.