[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

How python knows where non standard libraries are stored ?


List sys.path contains all paths where python shall
look for libraries.

Eg on my system, here is the content of sys.path:

 >>> import sys
 >>> sys.path
'C:\\Program Files\\Python36-32\\',
'C:\\Program Files\\Python36-32\\DLLs',
'C:\\Program Files\\Python36-32\\lib',
'C:\\Program Files\\Python36-32',
'C:\\Program Files\\Python36-32\\lib\\site-packages']

The last path is used as a location to store libraries
you install yourself.

If I am using a virtual environment (with venv) this last
path is different


I looked for windows environment variables to tell python
how to fill sys.path at startup but I didn't found.

So how does it work ?