I’ve installed Python 2.7 alongside Python 2.4 as instructed here. When running a tests through Mac OSX Terminal connecting to the Server to confirm that the install is working I execute this test:
import Image
img = Image.open("/directory/image.jpg")
img.load()
print img
Result:
<PixelAccess object at 0x2b97d4c25110>
<JpegImagePlugin.JpegImageFile image mode=RGB size=75x75 at 0xFEF4050>
However, when executing this using PHP’s exec() or through a Coda extension Run Script for Coda, I get the error:
ImportError: No module named Image
I’ve also tried from PIL import Image which does not make a difference. Something else to note is that when I check to make sure that the support is there I get this which indicates that the proper image support is available:
*** TKINTER support not available
--- JPEG support available
--- ZLIB (PNG/ZIP) support available
--- FREETYPE2 support available
*** LITTLECMS support not available
Question: Any ideas on how to fix this?
@stwhite I suggest you to use virtualenv (http://www.virtualenv.org/en/latest/index.html) for multiple projects to live in their own environments.
Usefull wrapper for virtualenv http://www.doughellmann.com/projects/virtualenvwrapper/
My own projects live in their own virtualenvs and its really awesome.
Here is the question about creating virtualenv with specific python version Use different Python version with virtualenv
Note
May be you’ll have problems when installing PIL into the virtualenv
Solution
Hope this will work for you too,
Thanks,
Sultan