tags:

views:

2471

answers:

3

In ruby the library path is provided in $", in perl it's in @INC - how do you get the list of paths that Python searches for modules when you do an import?

+5  A: 
import sys
sys.path
John Millikin
+10  A: 

I think you're looking for sys.path

import sys
print sys.path
Jack M.
+8  A: 

You can also make additions to this path with the PYTHONPATH environment variable at runtime, in addition to:

import path
sys.path.append('/home/user/python-libs')
Andrew Gwozdziewycz