-   Slackware (
-   -   Install PIL on different version of Python (

dc_eros 01-07-2013 09: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:

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:

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


knudfl 01-07-2013 09:56 PM

Changing the python version used at build time :
1) Unpack 'Imaging-1.1.7.tar.gz'
2) Edit line 1 in '' 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 10: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".




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


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 04:42 AM.