PythonPath for ASP
Jim Abrams
jim at publishingresources.com
Tue Jul 31 11:05:25 EDT 2001
Levente Sandor <nospam at newsranger.com> wrote in
<uMn97.12165$ar1.37961 at www.newsranger.com>:
>In article <996471911.551564 at emperor.labs.agilent.com>, Brian Zhou
>says...
>
>> Is there a place I can set that makes C:\Python21\PIL in PythonPath?
>
>Create a file with the extension ".pth" in your Python installation
>directory, then add the line PIL
>to it. You can add more (both relative and absolute) paths to the Python
>path in this way, each one in a new line. (You must restart the Python
>interpreter after doing this.)
>Or: you can do it (temporarily) anywhere in your script:
>import sys
>sys.path.append("c:\\python21\\pil")
>import Image
Remember that the sys module is cached, so repeat calls to this would
pollute the path.
Maybe:
if "c:\\python21\\pil" not in sys.path: sys.path.append("c:\\python21\\pil")
>Another way goes trough the Windows Registry but I never tried that.
HKLM/Software/Python/PythonCore/2.1/PythonPath
With 2.1 being whatever version you have.
Also site-packages isn't in your path. You might want to add it. It doesn't
seem to get in there on windows.
More information about the Python-list
mailing list