python 当前目录_Python中的搜索路径顺序

05423d0889ec7dd45624179afa8691dd.png

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】,可以免费获取为你精心准备的的电子书籍

更多小知识分享,请关注百度白月黑羽,或点击下方【了解更多】,查看更多相关内容

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值