Environmental variable $PYTHONPATH

cestluk cestluk at polyu.edu.hk
Sat Apr 29 12:12:35 CEST 2000


Please excuse me if this rather dumb question has been answered before. It 
does not seem to be in the FAQ, though.

It seems that each time you add a new library/module to your current python 
installation, you have to make it known to python manually, for example, by 
editing $PYTHONPATH or including it in the search path by invoking sys.path(). 
I am using the W32 version of python 1.6 and the sys.path output looks 
something like

'', 'C\\Python16\\win32', 'C\\Python16\\win32\\lib', 'C\\Python16', 
'C\\Python16\\Pythonwin', 'C\\PYTHON16\\DLLs', 'C\\PYTHON16\\lib', 
'C\\PYTHON16\\lib\\plat-win', 'C\\PYTHON16\\lib\\lib-tk', 
'C\\PYTHON16\\PYTHONWIN', 'C\\PYTHON16']

It seems you have to specify the name of _every_ directory and subdirectory. 
Doing this manually would be quite tedious if you have a lot of modules to 
install. Is there a simpler/less manual way to do it?

I am thinking of the case of TeX (in tetex) where the system installation is 
under a certain texmf tree and the user's own packages are under another and 
running kpathsea will set up the search path for the packages.

Regards,
ST
--





More information about the Python-list mailing list