I’m new to python, and I find that to see the import search paths, you have to import the sys module and than access the list of paths using sys.path, if this list is not available until I explicitly import the sys module, so how the interpreter figure out where this module resides.
thanks for any explanation.
I’m new to python, and I find that to see the import search paths,
Share
The module search path always exists, even before you import the sys module. The sys module just makes it available for you.
It reflects the contents of the system variable
$PYTHONPATH, or a system default, if you have not set that environment variable.