Extensions do not work with Mac OS X Lion

Bug #819209 reported by MORATI François on 2011-08-01
78
This bug affects 11 people
Affects Status Importance Assigned to Milestone
Inkscape
Medium
su_v

Bug Description

Inkscape v.0.48.1 . Computer ; iMac Intel 2,4 GHz intel core 2 duo : RAM 2 Go 667 MHz
With Mac OS X 10.6 (Snow Leopard) the ''Extensions'' menu works very well.
With Mac OS X 10.7 (Lion), the ''extensions '' men does not work (as the Inkscape 0.48 version with Mac OS 10.6).

Thank you. greetings.

su_v (suv-lp) wrote :

Which python version is installed by default on Mac OS X Lion?

Open a terminal window and type these two commands:
  which python
  python --version

and paste the output here.

(It seems likely that Mac OS X Lion updated the system version of Python to Python 2.7 - the available Inkscape packages for Mac OS X do not include the required python modules (lxml, numpy) for that version of python).

tags: added: extensions-plugins osx packaging
Windell Oskay (windell) wrote :

I can confirm this issue.

> which python
/usr/bin/python

> python --version
Python 2.7.1

I have been able to work around it by editing Inkscape.app/Contents/Resources/bin (as I did for the corresponding issue in 10.6, with Inkscape 0.48), to force Inkscape to use python 2.5.

su_v (suv-lp) on 2011-08-02
summary: - Extensions men does not work with Mac OS Lion
+ Extensions do not work with Mac OS X Lion
su_v (suv-lp) wrote :

Windell Oskay wrote:
> I can confirm this issue.

Thx for confirming!

Changed in inkscape:
assignee: nobody → Michael Wybrow (mjwybrow)
importance: Undecided → Medium
status: New → Confirmed
Windell Oskay (windell) wrote :

I have written a workaround patch and made it available for download (as part of the Eggbot extensions for Inkscape), for anyone needs a short-term workaround for this issue-- that is, before an official solution is released by the Inkscape developers.

You can download it here: http://code.google.com/p/eggbotcode/downloads/detail?name=EggBot2.2.2.r2.mpkg.zip

Full disclosure:
A. This is a totally unofficial hack, not endorsed in any way by the Inkscape developers. :)

B. The download is a standard Mac installer package for the Eggbot extensions for Inkscape, which installs the following software:

1) The Eggbot extensions for Inkscape, a set of Inkscape Extensions for creating drawings for and operating an Eggbot,
2) The Hershey Text extension for Inkscape, a "render" extension for drawing stroke-based text, and
3) The patch to Inkscape.app, for version 0.48 and newer, which allows extensions to operate properly under MacOS 10.7.

C. This is free software, licensed under the GPL, released in the hopes that it will be helpful, but released strictly on an as-is basis.

su_v (suv-lp) wrote :

Attaching the patch used in the EggBot installer (2.2.2.r2) for easier review, diffed against lp:inkscape r10527.

su_v (suv-lp) wrote :

I don't have access to Lion yet, but I'm wondering if it would be possible to use Apple's Python 2.6 in 32bit mode on Lion, too (as currently happens on Snow Leopard) instead of resorting brute-force to Python 2.5 (32bit) on both Snow Leopard and Lion?

su_v (suv-lp) wrote :

@Windell - AFAICT Apple hasn't published the man pages from Lion yet (the python man page still refers to Snow Leopard and earlier versions of Mac OS X). Could you verify whether setting the environment variable 'VERSIONER_PYTHON_VERSION' is still supported on OS X Lion? (see 'man python').

Attaching a diff for testing which aims to default to Python 2.6 in 32bit mode on system versions which support these environment variables ('/usr/bin/python' actually being a wrapper to «select the real version of Python to run, depending on various settings.»)

Windell Oskay (windell) wrote :

>but I'm wondering if it would be possible to use Apple's Python 2.6 in 32bit mode

Not sure. If that were the case, would one expect extensions in 0.48.1 to already work in 10.7?

I'm willing to run any tests that you can specify here. :)

su_v (suv-lp) wrote :

> Not sure. If that were the case, would one expect
> extensions in 0.48.1 to already work in 10.7?

No. The file your installer patches in current Inkscape packages only sets $VERSIONER_PYTHON_PREFER_32_BIT but does not require a specific the python version ($PATH is set to run 'python' from '/usr/bin'). [1]

With Python 2.7.1 new in Lion as default python version, Apple has probably no reason (legacy) to include a 32bit version in the universal binary (Lion is full 64bit, and Python 2.7 was never shipped with a 32bit-only version of Mac OS X). Thus I assume that on Lion, setting $VERSIONER_PYTHON_PREFER_32_BIT alone fails if the python version is not limited to an earlier python version which includes 32bit binaries due to legacy reasons (using $VERSIONER_PYTHON_VERSION).

> I'm willing to run any tests that you can specify here.

1) Could you look up the man page for python ('man python' in the terminal) whether on OS X Lion it still supports the same environment variables as on Snow Leopard? [2] As mentioned above, I can't find the python man page for OS X Lion online.
2) For testing, could you use the diff I attached in comment #7 to change an _original_ version of 'Inkscape.app/Contents/Resources/bin/inkscape' of 0.48.1 or 0.48.2 (i.e. not one patched by your installer!) and test on OS X Lion if Inkscape then launches Python 2.6 in 32bit mode (using e.g. the debug extension from bug #482993)?

[1] <http://bazaar.launchpad.net/~inkscape.dev/inkscape/RELEASE_0_48_BRANCH/view/head:/packaging/macosx/Resources/bin/inkscape#L26>
    <http://bazaar.launchpad.net/~inkscape.dev/inkscape/RELEASE_0_48_BRANCH/revision/9719>
[2] <http://developer.apple.com/library/mac/#documentation/Darwin/Reference/ManPages/man1/python.1.html>

su_v (suv-lp) wrote :

> With Python 2.7.1 new in Lion as default python version (…)

Minor correction to my prior argument:
Even if the universal binary of Python 2.7 includes a 32bit version, it would not help with current Inkscape packages on OS X Lion because they do not include the required python modules for python 2.7 (lxml and numpy are included in Inkscape.app for Python 2.3-2.6, in 32bit).

For now, the easiest solution would be to modify the launcher script to run Python 2.6 in 32bit mode on both systems (Snow Leopard, Lion) - of course only if supported by '/usr/bin/python' on Lion.

Windell Oskay (windell) wrote :
Download full text (5.3 KiB)

>With Python 2.7.1 new in Lion as default python version

Not sure what the story is with that. 'man python' says: "The current supported versions are 2.6 and 2.7, with the default being 2.6." Either the man page is out of date, or my system is not in the default configuration. It would be helpful if someone else with Lion could check the default python version.

>1) Could you look up the man page for python ('man python' in the terminal) whether
> on OS X Lion it still supports the same environment variables as on Snow Leopard?

Yes, it appears so:

" Versions 2.6 and 2.7 support 64-bit execution (which is on by default).
Like the version of Python, the python command can select between 32 and 64-bit execution (when both are available). Use:
           % defaults write com.apple.versioner.python Prefer-32-Bit -bool yes
     to make 32-bit execution the user default."

>2) For testing, could you use the diff I attached in comment #7[...]

Trace is copied below.

Default Encoding: ascii
----------------------------------------
Filesystem Encoding: utf-8
----------------------------------------
Platform: darwin
----------------------------------------
Python sys.version_info: 2.6.6
Python sys.version:
2.6.6 (r266:84292, Jun 16 2011, 16:59:17)
[GCC 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00)]
----------------------------------------
Python sys.executable:
 /usr/bin/python
Python sys.exec_prefix:
 /System/Library/Frameworks/Python.framework/Versions/2.6
Python sys.prefix:
 /System/Library/Frameworks/Python.framework/Versions/2.6
----------------------------------------
lxml path: /Applications/Inkscape.app/Contents/Resources/python/site-packages/i386/2.6/lxml
LXML_VERSION: 2.1.3.0
LIBXML_VERSION: 2.7.3
LIBXML_COMPILED_VERSION: 2.7.1
LIBXSLT_VERSION: 1.1.24
LIBXSLT_COMPILED_VERSION: 1.1.24
----------------------------------------
numpy path: /Applications/Inkscape.app/Contents/Resources/python/site-packages/i386/2.6/numpy
numpy version: 1.3.0.dev5986
----------------------------------------
sys.path:
 /Applications/Inkscape.app/Contents/Resources/extensions
 /Applications/Inkscape.app/Contents/Resources/extensions
 /Applications/Inkscape.app/Contents/Resources/python/site-packages/i386/2.6
 /System/Library/Frameworks/Python.framework/Versions/2.6/lib/python26.zip
 /System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6
 /System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/plat-darwin
 /System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/plat-mac
 /System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/plat-mac/lib-scriptpackages
 /System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python
 /System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/lib-tk
 /System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/lib-old
 /System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/lib-dynload
 /Library/Python/2.6/site-packages
 /System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/PyObjC
----------------------------------------
os.environ:
FONTCONFIG_PATH
 /Applications/Inksca...

Read more...

su_v (suv-lp) wrote :

> >2) For testing, could you use the diff I attached in comment #7[...]
> Trace is copied below.

From the trace:
> Python sys.version:
> 2.6.6 (r266:84292, Jun 16 2011, 16:59:17)
> Python sys.executable:
> /usr/bin/python
> Python sys.exec_prefix:
> /System/Library/Frameworks/Python.framework/Versions/2.6
> lxml path: /Applications/Inkscape.app/Contents/Resources/python/site-packages/i386/2.6/lxml
> numpy path: /Applications/Inkscape.app/Contents/Resources/python/site-packages/i386/2.6/numpy

Thanks a lot for testing, much appreciated! AFAICT the diff works as expected and would allow to use Apple's Python 2.6 (32bit) with Inkscape.app on both Snow Leopard and Lion out-of-the-box (until additional modules for later Python versions are bundled with Inkscape.app).

Changed in inkscape:
milestone: none → 0.48.2
status: Confirmed → Triaged
su_v (suv-lp) on 2011-09-06
Changed in inkscape:
milestone: 0.48.2 → 0.48.3
su_v (suv-lp) wrote :

Patch against current trunk (r10819) to force Inkscape to use 32bit Python 2.6 (effective on Snow Leopard and Lion, gets ignored on Leopard - no need to use any 'if/else' checks for osx version)

<off-topic, relevant for planned bug-fix release 0.48.3>
Note: One of the macosx packaging scripts in the 0.48.x branch had never been updated with required changes (which are in current trunk, e.g. revision 10026) before or after the release of 0.48.2 - @Michael, could you commit the changes you must have used locally in 'osx-app.sh' to create the package for 0.48.2 (to adjust for the upstream changes of the gdk-pixbuf-2.0 library) to the 0.48.x tree?
</off-topic>

su_v (suv-lp) wrote :

Forgot to add (or an earlier comment of mine got lost/never written ;) ):
patch tested with the official 0.48.2 package on Mac OS X 10.5.8 Leopard as well as OS X 10.7.2 Lion (the required changes are modifying a shell script inside the app bundle - for testing, they can be applied to the packaged app, without the need to recompile and repackage).

Salvatore (george-raul) wrote :

Hello, I can confirm that suv's patch works on Mac OS X 10.7.2 (Inkscape 0.48.2 r9819). I have opened the .dmg file, gone into Contents/Resources/bin and then manually edited file "inkscape", inserting the new line as described in the diff. Then I launched Inkscape, and now the extensions work. Great! Thanx, suv

su_v (suv-lp) on 2012-01-30
tags: added: backport-proposed
ScislaC (scislac) on 2012-02-08
Changed in inkscape:
status: Triaged → Fix Committed
assignee: Michael Wybrow (mjwybrow) → ~suv (suv-lp)
su_v (suv-lp) on 2012-02-08
tags: removed: backport-proposed
Ted Gould (ted) on 2012-02-15
Changed in inkscape:
status: Fix Committed → Fix Released

Great news about the fix, but I have not understood this discussion well enough to understand how to enable the fix. How exactly do I do it?

su_v (suv-lp) wrote :

> How exactly do I do it?

You patiently wait until packagers have had the time and resources to make new packages for Mac OS X available based on the sources of the latest bug-fix release. As soon as the new packages are available, the bug-fix release will be announced on inkscape.org.

<off-topic>
If you are an impatient user and are comfortable with modifying a file or two inside application bundles, you can apply the workaround described here yourself to Inkscape 0.48.2. Note that detailed instructions for users are outside the scope of the bug tracker: see for example related questions in the 'Answers' section for Inkscape here at launchpad:

Prerequisites:
- unmodified version of Inkscape 0.48.2 installed
  (NOTE: best practice might be to drag and drop a copy of Inkscape.app from the DMG it into your own user account - editing the one installed in /Applications might fail if you don't have the necessary privileges)
- alternative text editor is available
  (NOTE: Apple's TextEdit will *not* work due to the new Autosave gimmick on Lion)
- quit all open Inkscape windows

Detailed instructions:
<https://answers.launchpad.net/inkscape/+question/194132#comment-4> and below
</off-topic>

I'm not very patient :) I followed the instructions you linked to, and voila, extensions work. Thank you!

Jan-Peter (ftjp) wrote :

Hello,
I was running into an issue with the reported Bug. Here is the problem:

I am running Mountain Lion and wanted to export from Inkscape to tikz, since beamer and pstricks is not an easy one...

I thought I followed the above instructions (written for 10.7, if I understood the discussion above correctly) but could not get the extensions to work.
First, I installed the .mpkg.zip file from above successfully.
Second, I edited the "inkscape" file in the way described here (https://answers.launchpad.net/inkscape/+question/194132#comment-4 ).

Inkscape launches after modification of the file, but the file created by "save as" -> "tikz" is still empty. Inkscape produces the apparently famous "lxml" error message (this extension requires "python-lxml" and so forth).

I am running Mac OS 10.8.2, Intel Core 2 Duo 2,26MHz
Inkscape 0.48.2 r9819

Your help will be much appreciated!
Greets
j-p

su_v (suv-lp) wrote :

> First, I installed the .mpkg.zip file from above successfully.
> Second, I edited the "inkscape" file in the way described here
> (https://answers.launchpad.net/inkscape/+question/194132#comment-4 ).

it's either / or - don't use both (the installer for the Egg-Bot extensions mentioned in comment #4 is an external project, and not required for the recommended workaround in comment #17). If you follow the instructions from <https://answers.launchpad.net/inkscape/+question/194132#comment-4> exactly, with an otherwise unmodified version of the original Inkscape package, the python-based extensions bundled with Inkscape do work (e.g. 'Extensions > Render > Gear…' as one example for easy testing).

> (…) wanted to export from Inkscape to tikz (…)

If you need help with getting an external extension installed and running (once Inkscape's own extensions work ok), please ask a new question in <https://answers.launchpad.net/inkscape> (the bug tracker is not a support forum). Don't forget to provide information and links about that custom external extension (Inkscape itself does not include an extension to export to tikz).

description: updated
Windell Oskay (windell) wrote :

Encountering this bug again with Inkscape 0.48.5 on MacOS 10.10

 (Tested e.g., with Extensions > Render > Gear…)

su_v (suv-lp) wrote :

@Windell Oskay - please file a separate report, this is a new package, and some of the internals have changed.

For the new port, please run 'Extensions > Debug > Python module info' and attach the output to the report.

su_v (suv-lp) wrote :

@Windell Oskay - … and please make sure to test with an unmodified package (do not run your current eggbot installer on that package): last time I checked, it forces the usage pf Python 2.5 (it is not necessary to revert to that old version of Python), and according to reports on the web, the second update of the public Beta Yosemite seems to have removed (or at least broken) support for Python 2.5.

Windell Oskay (windell) wrote :

Thank you ~suv.

For future reference, new bug report is here: https://bugs.launchpad.net/inkscape/+bug/1363521

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers