| Issue 120: | PIL for 0.4 on OSX imports as Image, not PIL.Image | |
| 1 person starred this issue and may be notified of changes. | Back to list |
On OSX 10.6 I installed PIL via easy_install to site-packages. It created a PIL egg that directly contains Image.py. So in order to get PIL's Image class, I do `import Image` instead of `import PIL.Image`. We need to keep that in mind for PIL availability checking. http://paste.pocoo.org/show/154672/
Jan 4, 2010
(No comment was entered for this change.)
Status:
Done
Jan 14, 2010
I think I may have to reopen this issue. $ python # With a custom PIL installation via easy_install or so I believe... Python 2.6.4 (r264:75821M, Oct 27 2009, 19:48:32) [GCC 4.0.1 (Apple Inc. build 5493)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import Image $ /opt/local/bin/python2.6 # With PIL from py26-pil darwinports package Python 2.6.3 (r263:75183, Jan 11 2010, 16:49:49) [GCC 4.2.1 (Apple Inc. build 5646) (dot 1)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import PIL The problem with the first version is that it has problems loading the _imaging binary that PIL uses. (It's there but doesn't load due to some symbol not defined error). Some apps (mtmaps, e.g.) use it. So, if we write in our guide that users should install py26-pil, we should use the proper import.
Status:
Accepted
Labels: -Priority-Medium Priority-High
Jan 14, 2010
So, you confirm that it's import PIL.Image, and not import Image ?
Jan 14, 2010
Check this: I thought the simple "import Image" only worked before because I still had my adjusted pythonpath around. But now I think that both work. geekbook:~ dennda$ export PYTHONPATH= geekbook:~ dennda$ echo $PYTHONPATH geekbook:~ dennda$ /opt/local/bin/python2. python2.5 python2.5-config python2.6 python2.6-config geekbook:~ dennda$ /opt/local/bin/python2. python2.5 python2.5-config python2.6 python2.6-config geekbook:~ dennda$ /opt/local/bin/python2.6 Python 2.6.3 (r263:75183, Jan 11 2010, 16:49:49) [GCC 4.2.1 (Apple Inc. build 5646) (dot 1)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import PIL >>> import PIL.Image >>> import Image >>> import _imaging >>> Image.__file__ '/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/PIL/Image.pyc' >>> PIL.__file__ '/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/PIL/__init__.pyc' >>> PIL.Image.__file__ '/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/PIL/Image.pyc' >>> _imaging.__file__ '/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/PIL/_imaging.so' >>> Note that it's the same __file__. That's via py26-pil now.
Jan 14, 2010
ok thanks :)
Jan 14, 2010
(No comment was entered for this change.)
Status:
Done
|
Owner: txprog
Labels: Milestone-0.4 Component-Core