Python's docs state that sys.path
is initialized from the following locations:
- the directory containing the input script,
PYTHONPATH
, and- "the installation-dependent default".
print(',\n'.join(sys.path))
produces the following output on my system (no script given, no PYTHONPATH
set, Ubuntu):
,
/usr/lib/python36.zip,
/usr/lib/python3.6,
/usr/lib/python3.6/lib-dynload,
/home/owl/.local/lib/python3.6/site-packages,
/usr/local/lib/python3.6/dist-packages,
/usr/lib/python3/dist-packages
So, except ''
apparently all the directories belong to "the installation-dependent default".
What is the idea behind this directory layout?
Why five different directories? Which modules go where?