![05423d0889ec7dd45624179afa8691dd.png](https://i-blog.csdnimg.cn/blog_migrate/58f89a4655e2bc0e355192115f4cc854.jpeg)
Python中的搜索路径
搜索顺序依次如下
1. 当前目录
2. 环境变量PYTHONPATH中的目录
3. Python安装目录(for Linux OS:/usr/local/lib/python
When a module named spam is imported, the interpreter search for a file named spam.py in the current directory
and then in list of directoried specified by the enviroment variable PYTHONPATH. This has the same syntax as the shell variable PATH, that is, a list of directory names. When PYTHONPATH is not set, or when the file is not found there, the search continues in an installation-dependent default path; on Unix, this is usually(/usr/local/lib/python)
私信我【Python】,可以免费获取为你精心准备的的电子书籍
更多小知识分享,请关注百度白月黑羽,或点击下方【了解更多】,查看更多相关内容