On 7/11/09 22:31, Chris Mohler wrote:
On Sun, Nov 8, 2009 at 3:05 PM, JiHO <jo.lists@...400...> wrote:
Basically we need to test with a recent lxml version in MacPorts + the old one in Inkscape.app and check which one gets loaded in Inkscape eventually. I'll have to do some digging to check how I can get access to the lxml version used from within Inkscape so if someone wants to test that before me, by all means, please do! ;)
Maybe this is helpful: https://bugs.launchpad.net/inkscape/+bug/448285/comments/9 https://bugs.launchpad.net/inkscape/+bug/448285/comments/10
I'm on linux, so my ability to help set on OS X is nil :( (Inkscape uses the system-wide lxml here)
But this: export PYTHONPATH="$PYTHONPATH:$TOP/python/site-packages/$ARCH/$PYTHON_VERS" seems worth a shot to me.
The problem is: the current launch script doesn't see any user environment configuration, so $PYTHONPATH initially will always be empty... except we want to load only modules installed in assumed default locations (system python, macports), like this for example:
# Setup PYTHONPATH to use python modules shipped with Inkscape ARCH=`arch` PYTHON_VERS=`python -V 2>&1 | cut -c 8-10` # testing new PYTHONPATH proposed by JiHO in 'inkscape-devel' 07.11.09 22:05 # including predefined module paths (system python, macports) # # 3rd party modules for Python 2.5.1 on OS X 10.5.8 should be installed into # /Library/Python/2.5/site-packages # 3rd party modules for Python 2.6.1 on OS X 10.6.x should be installed into # /Library/Python/2.6/site-packages ??? # local modules compatible with system python 2.5.1 on OS X 10.5.8: # $MACPORTS_PREFIX/lib/python2.5/site-packages # $MACPORTS_PREFIX/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/ # local modules compatible with MacPorts python 2.6.x on OS X 10.5.8: # $MACPORTS_PREFIX/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/ # MACPORTS_PREFIX="/Volumes/blue/mp" #MACPORTS_PREFIX="/opt/local" MACPORTS_PYTHONPATH="$MACPORTS_PREFIX/Library/Frameworks/Python.framework/Versions/$PYTHON_VERS/lib/python$PYTHON_VERS/site-packages/" SYSTEM_PYTHONPATH="/Library/Python/$PYTHON_VERS/site-packages/" export PYTHONPATH="$SYSTEM_PYTHONPATH:$MACPORTS_PYTHONPATH:$TOP/python/site-packages/$ARCH/$PYTHON_VERS"
works for me with Inkscape 0.47pre4 from sf.net, system Python 2.5.1 and my updated MacPorts modules.
TODO: 1) verify paths: - default path to the Python frameworks in MacPorts installed in '/opt/local' - default path to site-packages for the system Python on OS X 10.6 Snow Leopard 2) test modules: - any module installed for the system Python on 10.5 and 10.6. 3) what about OS X 10.4 Tiger? 4) precedence of system Python over MacPorts modules or vice versa?
~suv
attached: diff for 'inkscape', 0.47pre4 (r22446)
--- inkscape-orig.sh 2009-10-18 18:29:05.000000000 +0200 +++ inkscape 2009-11-08 03:26:53.000000000 +0100 @@ -26,9 +26,27 @@ # Setup PYTHONPATH to use python modules shipped with Inkscape ARCH=`arch` PYTHON_VERS=`python -V 2>&1 | cut -c 8-10` -export PYTHONPATH="$TOP/python/site-packages/$ARCH/$PYTHON_VERS" +#export PYTHONPATH="$TOP/python/site-packages/$ARCH/$PYTHON_VERS" # NB: we are only preprending some stuff to the default python path so if the directory does not exist it should not harm the rest
+# testing new PYTHONPATH proposed by JiHO in 'inkscape-devel' 2009-11-07 +# including predefined module paths (system python, macports) +# +# 3rd party modules for Python 2.5.1 on OS X 10.5.8 should be installed into: +# /Library/Python/2.5/site-packages +# 3rd party modules for Python 2.6.1 on OS X 10.6.x should be installed into: +# /Library/Python/2.6/site-packages ??? +# local modules compatible with system python 2.5.1 on OS X 10.5.8: +# $MACPORTS_PREFIX/lib/python2.5/site-packages +# $MACPORTS_PREFIX/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/ +# local modules compatible with MacPorts python 2.6.x on OS X 10.5.8: +# $MACPORTS_PREFIX/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/ +# +MACPORTS_PREFIX="/opt/local" +MACPORTS_PYTHONPATH="$MACPORTS_PREFIX/Library/Frameworks/Python.framework/Versions/$PYTHON_VERS/lib/python$PYTHON_VERS/site-packages/" +SYSTEM_PYTHONPATH="/Library/Python/$PYTHON_VERS/site-packages/" +export PYTHONPATH="$SYSTEM_PYTHONPATH:$MACPORTS_PYTHONPATH:$TOP/python/site-packages/$ARCH/$PYTHON_VERS" + # No longer required if path rewriting has been conducted. # export DYLD_LIBRARY_PATH="$TOP/lib"