美文网首页
python package manage

python package manage

作者: loinliao | 来源:发表于2018-07-10 11:30 被阅读0次

一、how does Python know where to find packages when you call import?

  1. use sys.path

二、How sys.path gets populated

As the docs explain, sys.path is populated using the current working directory, followed by directories listed in your PYTHONPATH environment variable, followed by installation-dependent default paths, which are controlled by the site module.

三、pip国内镜像源配置

手动指定:pip -i http://pypi.douban.com/simple install dnspython
或者创建$HOME/.pip/pip.conf修改pip配置

[global]
trusted-host = mirrors.ustc.edu.cn
index-url = https://mirrors.ustc.edu.cn/pypi/web/simple

四、修改pip安装路径

手动指定:pip -t HOME/.pip/pip.conf修改pip配置 install sixHOME/.pip/pip.conf修改pip配置
target=$HOME/.pip/pip.conf修改pip配置

相关文章

网友评论

      本文标题:python package manage

      本文链接:https://www.haomeiwen.com/subject/vikfpftx.html