use of import of PIL incorrectly documented, or is it just me ?
Max Møller Rasmussen
maxm at normik.dk
Tue May 1 08:40:45 EDT 2001
> From: Fredrik Lundh [mailto:fredrik at pythonware.com]
> your copy of PIL isn't properly installed; from the README:
> If you're using Python 1.5 or later, the preferred way is to create
> a "PIL" subdirectory under "site-packages", copy the "PIL.pth" file
> to "site-packages", and the rest of the files to the new
Well what I have is:
C:\Python20\Lib\site-packages\PIL.pth
C:\Python20\Lib\site-packages\PIL\
C:\Python20\DLLs\_imaging.pyd
C:\Python20\DLLs\_imagingtk.pyd
I would believe that that should correspond to your approach. But I still
have to use:
from PIL import Image
Actually I have to use:
------------------------------------
import sys
sys.path.append('C:/Python20/Lib/site-packages')
from PIL import Image
im = Image.open("c:/temp/img.jpg")
im.show()
------------------------------------
I'm using Activestate 2.0. on windows 2000 Pro. Maybe there is something
wrong with my installation, or Activestates installer? It's all just plain
vanilla.
The below works, so The files must be in the correct Directory:
------------------------------------
import sys
sys.path.append('C:\\Python20\\Lib\\site-packages\\PIL')
import Image
im = Image.open("c:/temp/img.jpg")
im.show()
------------------------------------
Regards
Max M
More information about the Python-list
mailing list