Package Question - please help.

Alex Martelli aleax at aleax.it
Mon Dec 17 18:54:27 EST 2001


Jason Orendorff wrote:
        ...
>> I've added c:\package1 to the path
>> (by adding it in the registy -- is there an easier way?).
> 
> Sure.  You can use the PYTHONPATH environment variable
> or your Python program can modify the sys.path variable at runtime.

Or, often simplest, you can put a textfile with any name, extension .pth, 
listing the directories you want to add to the path, one per line, in the 
site-packages directory on Unix-oids or the C:\Python21 (or similar) on 
Windows-oids.  Then, site.py, which is run at each Python run unless you 
specifically inhibits, parses your .pth file and modifies sys.path itself.


Alex




More information about the Python-list mailing list