use of import of PIL incorrectly documented, or is it just me ?
Jim Abrams
jim at publishingresources.com
Tue May 1 09:39:42 EDT 2001
Max Møller Rasmussen <maxm at normik.dk> wrote in
<mailman.988720921.32079.python-list at python.org>:
>> 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')
Careful about using this if the interpreter isn't restarted every time (i.e.
Python in ASP) since this adds the path over and over.
Maybe
if sys.path.count('C:/Python20/Lib/site-packages') == 0:
sys.path.append('C:/Python20/Lib/site-packages')
Also site-packages isn't put into the Python Path with ActiveState
ActivePython. You can add it to the registry.
HKEY_LOCAL_MACHINE/Python/PythonCore/20/
Look at the other keys there and copy one and put in site-packages.
You'll have to do it again when/if you upgrade to 2.1
>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.
More information about the Python-list
mailing list