[Image-SIG] PIL for python 3.2

Ingo Randolf ingo at quitch.net
Mon Aug 29 16:46:25 CEST 2011


Hello.

Thanks for all the replies. it is working now!

it turned out, that there was a problem with libjpeg... i found some resources concerning the topic
pil on snow-leopard:

http://stackoverflow.com/questions/1518573/snow-leopard-python-2-6-problems-getting-pil-to-work
http://proteus-tech.com/blog/cwt/install-pil-in-snow-leopard/


----


what i did:

- remove all the libjpeg.* in various folders: /sw/lib /opt/local/lib (attention you might break something if you do that...)
- recompile and install libjpeg (8c) with ./configure --enable-shared --enable-static
- recompile PIL (i finally used this source: http://www.lfd.uci.edu/~gohlke/pythonlibs/#pil) 
	for non-windows version you have to alter the setup.py file though

	at the top you find:
if sys.platform == "win32":

after the if-block i added:

else:
    FREETYPE_ROOT = None
    JPEG_ROOT = libinclude("/usr/local")
    TIFF_ROOT = None
    ZLIB_ROOT = None
    TCL_ROOT = None
    LCMS_ROOT = None


see the JPEG_ROOT!

- after recompiling PIL i checked if _imaging.so is linking to libjepg:

$ otool -L build/lib.bla/_imaging.so
	/usr/local/lib/libjpeg.8.dylib (compatibility version 12.0.0, current version 12.0.0)
	/opt/local/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.5)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 125.2.0)

so linking went fine.

- after installing i could finally use PIL with python3.2

:)
great!

thx
ingo



Am 26.08.2011 um 19:03 schrieb Christoph Gohlke:

> Hi Ingo,
> 
> Before attempting to build PIL for Python 3.x make sure you are able to correctly build PIL for Python 2.x from the official source distribution. All tests should pass.
> 
> python setup.py clean --all
> python make-manifest.py
> python setup.py build_ext -i
> python selftest.py
> python Tests\run.py
> 
> Consider using PIL-1.1.7-py3-source.zip from <http://www.lfd.uci.edu/~gohlke/pythonlibs/#pil>. It builds and passes all selftests on my Windows and Ubuntu systems.
> 
> Christoph
> 
> 
> 
> On 8/26/2011 8:19 AM, Ingo Randolf wrote:
>> Hello.
>> 
>> another attempt to make PIL run with python3.2 on osx 10.6.7
>> 
>> I found an unofficial release of PIL for py3.2:
>> https://github.com/sloonz/pil-py3k/tree/a75c372ed17b3d06c0d58c1db03c9215da9c4bbb
>> 
>> it compiles and installs fine with python3.2
>> 
>> when i want to open an image i get:
>> IOError: cannot identify image file
>> 
>> with any type of image...
>> 
>> compiling PIL says:
>> --- TKINTER support ok
>> --- JPEG support ok
>> --- ZLIB (PNG/ZIP) support ok
>> --- FREETYPE2 support ok
>> 
>> 
>> i do:
>>>>> from PIL import Image
>>>>> im = Image.open("path/to/my/image.jpg")
>> 
>> i am on: osx 10.6.7
>> 
>> what am i doing wrong?
>> 
>> 
>> please help.
>> thanks
>> ingo
>> 
>> 
>> Am 23.08.2011 um 14:29 schrieb Ingo Randolf:
>> 
>>> hi all.
>>> 
>>> i had a look into porting PIL for use with python 3.2
>>> 
>>> well, it does compile now (osx 10.6), i can import PIL in python3.2, but when i try to load an image i get this traceback:
>>> 
>>> Traceback (most recent call last):
>>>  File "<stdin>", line 1, in<module>
>>>  File "/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site-packages/PIL/Image.py", line 1983, in open
>>>    raise IOError("cannot identify image file")
>>> IOError: cannot identify image file
>>> 
>>> this happens with any image-kind...
>>> 
>>> i am new to python, and to PIL... so i have no idea why this happens...
>>> 
>>> it would be great if PIL would be able to be used with python3.2!
>>> 
>>> maybe somebody more skilled than me can make it run?
>>> 
>>> here is the modified version:
>>> http://www.bildstrom.at/dl/Imaging-1.1.7_3.2.zip
>>> 
>>> ingo
>>> 
>>> 
>>> 
>>> Am 09.08.2011 um 18:18 schrieb Ingo Randolf:
>>> 
>>>> hello.
>>>> 
>>>> i want to use PIL with python 3.2.
>>>> Any ideas when PIL will be available for python32?
>>>> 
>>>> thanks
>>>> ingo
>>>> _______________________________________________
>>>> Image-SIG maillist  -  Image-SIG at python.org
>>>> http://mail.python.org/mailman/listinfo/image-sig
>>> 
>>> _______________________________________________
>>> Image-SIG maillist  -  Image-SIG at python.org
>>> http://mail.python.org/mailman/listinfo/image-sig
>> 
>> _______________________________________________
>> Image-SIG maillist  -  Image-SIG at python.org
>> http://mail.python.org/mailman/listinfo/image-sig
>> 
>> 
> _______________________________________________
> Image-SIG maillist  -  Image-SIG at python.org
> http://mail.python.org/mailman/listinfo/image-sig



More information about the Image-SIG mailing list