Python scripts/extensions broken on Mac OS X Leopard Leopard

Bug #345176 reported by Nathaniel Gray
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Inkscape
Invalid
Undecided
Unassigned

Bug Description

I'm using the standard Inkscape 0.46 Leopard download and OS X 10.5.6 Intel with the stock Python install. There are two problems I'm seeing.

First, if I choose the View->Scripts... menu item I get this message in the script pane:

# This is where you could type a script.
# However, no scripting languages have been compiled
# into Inkscape, so this window has no functionality.
# When compiling Inkscape, run "configure" with
# "--with-python" and/or "--with-perl".

This is obviously not desirable.

The second problem is a conflict with a MacPorts installation. Python-based extensions that use the inkex module can fail with this (misleading) 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

Printing out the *actual* exception instead of the canned message gives:

dlopen(/Applications/Applications/Graphics/Inkscape.app/Contents/Resources/python/site-packages/i386/2.5/lxml/etree.so, 2): Library not loaded: /opt/local/lib/libxml2.2.dylib
  Referenced from: /opt/local/lib/libexslt.0.dylib
  Reason: Incompatible library version: libexslt.0.dylib requires version 10.0.0 or later, but libxml2.2.dylib provides version 9.0.0

My guess is what's happening is that libexslt.0.dylib is being loaded from /opt/local/lib (since it's not shipped with Inkscape) and it in turn tries to load libxml2.2.dylib from the same place, instead of loading the one shipped with Inkscape. However, that version of libxml is too old so we get the error.

To fix the error you should probably ship libexslt with Inkscape. As a workaround until you update your packages users can do:

cd /Applications/Inkscape.app/Contents/Resources/lib
ln -s /usr/libexslt*.dylib .

Revision history for this message
manifold (keith) wrote :

I'm running Inkscape 0.47 on a Macbook with OS X 10.5.7 and Nathaniel's instructions helped. I'm now able to execute the built-in extensions for Inkscape. As admin on my machine I did:

> cd /Applications/Inkscape.app/Contents/Resources/lib
lib> ln -s /usr/lib/libexslt.0.dylib .
lib> ln -s /usr/lib/libexslt.dylib .
lib> ln -s /usr/lib/libexslt.la .

and that did the trick. I would never have figured this out without your help. Thanks Nathaniel. Btw, how did you get access to the "actual" exception?

Thanks,
Keith

Revision history for this message
Nathaniel Gray (n8gray-n8gray) wrote : Re: [Bug 345176] Re: Python scripts/extensions broken on Mac OS X Leopard Leopard

Hi Keith,

That's a good question, and I'm afraid I don't entirely remember the
answer. I think there's a python script somewhere in inkscape that
produces that message in response to an exception and I modified it to
print the exception instead.

Cheers,
-n8 (formerly of caltech.edu, BTW :-)

On Mon, Aug 3, 2009 at 10:23 PM, manifold<email address hidden> wrote:
> I'm running Inkscape 0.47 on a Macbook with OS X 10.5.7 and Nathaniel's
> instructions helped.  I'm now able to execute the built-in extensions
> for Inkscape.  As admin on my machine I did:
>
>> cd /Applications/Inkscape.app/Contents/Resources/lib
> lib> ln -s /usr/lib/libexslt.0.dylib .
> lib> ln -s /usr/lib/libexslt.dylib .
> lib> ln -s /usr/lib/libexslt.la .
>
> and that did the trick.  I would never have figured this out without
> your help.  Thanks Nathaniel.  Btw, how did you get access to the
> "actual" exception?
>
> Thanks,
> Keith
>
> --
> Python scripts/extensions broken on Mac OS X Leopard Leopard
> https://bugs.launchpad.net/bugs/345176
> You received this bug notification because you are a direct subscriber
> of the bug.
>
> Status in Inkscape: A Vector Drawing Tool: New
>
> Bug description:
> I'm using the standard Inkscape 0.46 Leopard download and OS X 10.5.6 Intel with the stock Python install.  There are two problems I'm seeing.
>
> First, if I choose the View->Scripts... menu item I get this message in the script pane:
>
> # This is where you could type a script.
> # However, no scripting languages have been compiled
> # into Inkscape, so this window has no functionality.
> # When compiling Inkscape, run "configure" with
> # "--with-python" and/or "--with-perl".
>
> This is obviously not desirable.
>
> The second problem is a conflict with a MacPorts installation.  Python-based extensions that use the inkex module can fail with this (misleading) 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
>
> Printing out the *actual* exception instead of the canned message gives:
>
> dlopen(/Applications/Applications/Graphics/Inkscape.app/Contents/Resources/python/site-packages/i386/2.5/lxml/etree.so, 2): Library not loaded: /opt/local/lib/libxml2.2.dylib
>  Referenced from: /opt/local/lib/libexslt.0.dylib
>  Reason: Incompatible library version: libexslt.0.dylib requires version 10.0.0 or later, but libxml2.2.dylib provides version 9.0.0
>
> My guess is what's happening is that libexslt.0.dylib is being loaded from /opt/local/lib (since it's not shipped with Inkscape) and it in turn tries to load libxml2.2.dylib from the same place, instead of loading the one shipped with Inkscape.  However, that version of libxml is too old so we get the error.
>
> To fix the error you should probably ship libexslt with Inkscape.  As a workaround until you update your packages users can do:
>
> cd /Applications/Inkscape.app/Contents/Resources/lib
> ln -s /usr/libexslt*.dylib .
>

--
http://n8gray.org

Revision history for this message
su_v (suv-lp) wrote :

Please see also possibly related bugs, especially the recent comments by Michael Wybrow:

Bug #392693 in Inkscape: “Conflict between bundled and system libxml dylib” (Comment #2)
Bug #398957 in Inkscape: “0.46 crashes on launch running under Mac OSX 10.6 (Snow Leapord)” (Comment #5)
Bug #400165 in Inkscape: “Binary Inkscape dist crashes when MacPorts is installed” (Comment #4)

@-n8: I'm curious how you got 'View > Scripts…' to work. Do you have a separate Java installation that is used by Inkscape to run the JVM? (see bug #373514) i.e. that provides a unix-style 'libjvm.so' instead of Apple's 'libjvm.dylib'?

~suv

Revision history for this message
Paul Lusch (plusch) wrote :

I'm also getting the same error with Ubuntu 9.04 Jaunty:

"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 have libxml2 (2.6.32.dfsg-5ubuntu4.2) and python-lxml (2.1.5-1ubuntu2) installed.

Inkscape 0.47pre3 r22311

su_v (suv-lp)
tags: added: extensions-plugins osx packaging
Revision history for this message
su_v (suv-lp) wrote :

@Paul - this bug report describes a specific library version conflict (Inkscape's bundled vs. MacPorts' installed libxml2 and libexslt) on OS X. Please file a separate report for your problem with Inkscape extensions when using the Ubuntu package so that it can be looked into accordingly.

Revision history for this message
birdsaregood (ariel36) wrote :

0.47 has been released, there's a Snow Leopard download for it, yet when I try a python extention I still get the "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" error.

Is progress being made? Will there be a 0.47.1 out soon with this fix? It'll be a bummer to not be able to use them till 0.48.

Revision history for this message
su_v (suv-lp) wrote :

@birdsaregood - this issue is known, but not yet solved. If you want to be notified about further developments subscribe to this report:
Bug #482993 “Inkscape extensions do not work on MacOS X 10.6 (Snow Leopard)”
<https://bugs.launchpad.net/inkscape/+bug/482993>

Revision history for this message
su_v (suv-lp) wrote :

Closing (obsolete):

1) The 'Script' dialog has been unhooked since Inkscape 0.47.

2) Conflicts with custom python installations:
Current (as well as future) Inkscape packages for Mac OS X (will) have rewritten loader paths of included dylibs, and no longer produce failures as originally described in this report (older packages relied on $DYLD_LIBRARY_PATH to load shared libraries from within the application bundle). Either methods has drawbacks though, and mixing binary libraries shipped with the application bundle with (likely) newer versions installed locally via MacPorts will inherently risk to run into binary incompatibilities (for details with regard to current packages (0.48.2), see also Michael's comments in bug #482993).

Future packages based on newer packaging scripts and GTK+/Quartz (currently work-in-progress, see mailing list) will make use of more advanced library path rewriting techniques (employing both "@executable_path and "@loader_path" for relative paths), which should allow included python modules like lxml, numpy and UniConvertor to import without error with either Python binary (system (Apple) or custom (MacPorts)).

Feel free to comment and reopen the report if you think that it was closed in error and that the same issues originally reported for Inkscape 0.46 in 2009 still apply to the current available package for Mac OS X (0.48.2), and the latest RC packages for 0.48.4 (see mailing list).

Changed in inkscape:
status: New → Invalid
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.