where is sys.path initialized?

Alex lidenalex at yahoo.se
Fri Sep 9 18:19:03 EDT 2005


No one is answering this question. Why, is it a bit unclear or what?
All I wanted to do was to add the path C:\Python24\mypython to the
sys.path so that I could put all my stuff there instead of mixing it
with the stuff that comes with the installation. And I wanted to do it
permanently som that I wouldn't have to use sys.path.append every time
I started Python interpreter.

Here is what I did, and it worked, but I still don't know why. If
somebody has an explanation please tell me.

1. My computer -> Properties->Advanced->Environment variables->System
variables ->New

2. In Variable name field enter PYTHONPATH and in Variable value field
enter C:\Python24\mypython

3. OK, OK, OK to close all the dialog boxes.

4. Restart the computer (it's essential to restart the computer and not
just the Python shell).

5. Open the Python shell and enter
>>> import sys
>>> sys.path
If you've done exactly as I've described here you should see
C:\Python24\mypython in the list.

Alex




More information about the Python-list mailing list