Python PYTHONPATH search path is, by default we import the module from PYTHONPATH will find inside.
Use the following code can be printed PYTHONPATH:
print (os.sys.path)
PYTHONPATH one of my items are as follows:
[
'D:\\Python3\\workspace\\PythonLab\\src',
'D:\\aptana3\\plugins\\org.python.pydev_2.7.0.2012080220\\pysrc',
'D:\\Python3\\python33.zip', 'D:\\Python3\\DLLs',
'D:\\Python3\\lib',
'D:\\Python3',
'D:\\Python3\\lib\\site-packages'
]
For example, I use the following import statement:
import urllib
Python interpreter will choose a path-by-path from the list above and then search until you find urllib module. Finally, here in the D: find \ Python3 under \ lib, as shown below:
Reproduced in: https: //www.cnblogs.com/GODYCA/archive/2013/05/31/3110410.html