LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (http://www.linuxquestions.org/questions/slackware-14/)
-   -   Install PIL on different version of Python (http://www.linuxquestions.org/questions/slackware-14/install-pil-on-different-version-of-python-4175444588/)

dc_eros 01-07-2013 08:00 PM

Install PIL on different version of Python
 
Currently at 13.37, python is 2.6.6 and also having an "altinstall" version of 2.7.3.

I wanted to install PIL from here: http://taper.alienbase.nl/mirrors/pe...imaging/build/

but it installs on 2.6.6. Maybe I could do a make altinstall as well but didn't tried it since the Slackbuild script have some magic going on (and it includes a patch as well) here: http://taper.alienbase.nl/mirrors/pe...ing.SlackBuild

Is there a way I can install PIL to python 2.7? Is there something like "installpkg pkg.txz altinstall" ? :D

TIA

knudfl 01-07-2013 08:56 PM

Changing the python version used at build time :
1) Unpack 'Imaging-1.1.7.tar.gz'
2) Edit line 1 in 'setup.py' from : #!/usr/bin/env python
.. to your python-2.7, like : #!/usr/bin/env python27

3) Repack the source to 'Imaging-1.1.7.tar.gz'.

dc_eros 01-07-2013 09:16 PM

Just built a couple of minutes ago.

What I did is modify the slackbuild script to reference the full path of "/usr/local/bin/python2.7" instead of just "python".

Ex:

http://taper.alienbase.nl/mirrors/pe...ing.SlackBuild

From

Code:

PYTHONINC=$( python -c 'from distutils.sysconfig import *;print get_python_inc()' )
to

Code:

PYTHONINC=$( /usr/local/bin/python2.7 -c 'from distutils.sysconfig import *;print get_python_inc()' )
I've edited other lines as well to do the same.


All times are GMT -5. The time now is 07:06 PM.