-
module search path
When the interpreter executes import statement(like
import sys) from any module, it searches forsys.pyin a list of directories assembled from the following sources:-
The directory from which the input script was run, or the current directory if the interpreter is being run interactively
-
The list of directories contained in the PYTHONPATH environment variable, if it is set.(The format for PYTHONPATH is OS-dependent but should mimic the PATH environment)
-
An installation-dependent list of directories configured configured at the time Python is installed
-
-
how to get it
The resulting search path is accessible in the Python variable sys.path, which is obetained from a module named sys:
理解module search path in Python
最新推荐文章于 2025-07-22 19:29:22 发布

最低0.47元/天 解锁文章
2506

被折叠的 条评论
为什么被折叠?



