[Tutor] Setting PYTHONPATH and other env vars dynamically

Kent Johnson kent37 at tds.net
Wed Aug 19 23:17:56 CEST 2009


On Wed, Aug 19, 2009 at 4:41 PM, Jramak<jramak345 at gmail.com> wrote:
>>
>> Sorry, I mean put the packages in the same directory as the python
>> script that needs them. The search path is sys.path which is affected
>> by PYTHONPATH among other things...
>>
>>
>
>
> sys.path is affected by PYTHONPATH ? how could it be affected by the
> PYTHONPATH ?

sys.path is the actual, runtime module search path. When Python is
started, it initialized sys.path from a variety of sources including
predefined locations, the contents of PYTHONPATH, and any .pth files
found.

http://docs.python.org/tutorial/modules.html#the-module-search-path

Kent


More information about the Tutor mailing list