@ Introducing Python: Modern Computing in Simple Packages by Bill Lubanovic (No. 3078 / 12833)
Where does Python look for files to import? It uses a list of directory names and ZIP archive files stored in the standard sys module as the variable path.
I've tried.
http://ideone.com/ymwEWM
import sys
for place in sys.path:
print(place)
run
/home/aE6sH9
/usr/lib/python35.zip
/usr/lib/python3.5
/usr/lib/python3.5/plat-x86_64-linux-gnu
/usr/lib/python3.5/lib-dynload
/usr/local/lib/python3.5/dist-packages
/usr/lib/python3/dist-packages
Reference: sys.path
A list of strings that indicate the path to search for the module. It is initialized with the PYTHONPATH environment variable and the default path specified during installation.
Recommended Posts