[Tutor] how to add directory to python search list

Peter Otten __peter__ at web.de
Sun Jul 17 09:47:07 CEST 2011


Surya P.K. Kasturi wrote:

> OS : Ubuntu Linux
> Python Version : 2.6.4
> 
> I have some third party modules to be installed in my computer.
> So, I want to add the module directory to python search list.

The way I find most convenient is to create a text file with the .pth suffix
in a directory that is already seen by Python. I use the file

~/.local/lib/python2.6/site-packages/lib.pth

That file contains paths to the directories you want Python to see, one path 
per line.






More information about the Tutor mailing list