Location of Python modules

Fredrik Lundh fredrik at pythonware.com
Mon Feb 13 13:27:10 EST 2006


"Byte" wrote:

> Pretty much self explanatry, where are Python modules stored in Linux?
> (i.e. in /usr/bin/local, or where?)

it depends on how and where Python is installed.  to see where they
are on your install, use

$ python -c "import sys; print sys.path"
['', '/usr/lib/python24.zip', '/usr/lib/python2.4', '/usr/lib/python2.4/plat-linux2',
'/usr/lib/python2.4/lib-tk', '/usr/lib/python2.4/lib-dynload',
'/usr/local/lib/python2.4/site-packages', '/usr/lib/python2.4/site-packages', ...

to check where a given module is installed, you can do

$ python -c "import cgi; print cgi.__file__"
/usr/lib/python2.4/cgi.pyc

hope this helps!

</F>






More information about the Python-list mailing list