How to add a library path to pythonpath ?

Mark Hammond skippy.hammond at gmail.com
Tue Mar 16 20:08:10 EDT 2010


On 17/03/2010 1:26 AM, Barak, Ron wrote:
> Thanks for the suggestion Pable.
> However, I really need the $PYTHONPATH to include this additional
> library, so all Python scripts could use it.
> In Windows I have defined PYTHONPATH as
> c:\views\cc_view\TS_svm_ts_tool\SVMInspector\lib\, and also in the
> Windows registry I have
> HKEY_LOCAL_MACHINE\SOFTWARE\Python\PythonCore\/version/\PythonPath\ as
> C:\Python26\Lib;C:\Python26\DLLs;C:\views\cc_view\TS_svm_ts_tool\SVMInspector\lib\;C:\Python26\Lib\lib-tk;
> However, even with all the above, the SVMInspecor modules are not found.

You need to create your own sub-key, with any name, under the PythonPath 
key and add your path there.  The reason is that Python only looks for 
that root key when it can't sniff the location of the library itself 
based on the location of the executable - and in most cases it can. 
Python does however enumerate and use the sub-keys in all cases.

HTH,

Mark



More information about the Python-list mailing list