pip使用国内镜像源的方法

发布时间:2020-06-16 15:59:05 作者:元一
来源:亿速云 阅读:179

pip 是一个安装和管理 Python 包的工具,Python pip默认安装模块路径是国外的服务器,本次我们将国外的服务器替换成国内的镜像服务器,来更好的安装Python的各种模块。

常用国内镜像:
(1)阿里云 http://mirrors.aliyun.com/pypi/simple/
(2)豆瓣http://pypi.douban.com/simple/
(3)清华大学 https://pypi.tuna.tsinghua.edu.cn/simple/
(4)中国科学技术大学 http://pypi.mirrors.ustc.edu.cn/simple/
(5)华中科技大学http://pypi.hustunique.com/
方法一:临时使用
加参数-i和镜像地址
例如:
pip install -i  https://pypi.tuna.tsinghua.edu.cn/simple scrapy
方法二:永久修改
linux:
修改:pip.conf没有创建一个文件夹及文件。文件夹要加".",表示是隐藏文件夹
[global]
index-url = https://pypi.tuna.tsinghua.edu.cn/simple
[install]
trusted-host = https://pypi.tuna.tsinghua.edu.cn
windows:
直接在用户目录中创建一个pip目录,如:c:\user\xx\pip,然后新建文件pip.ini,内容:
[global]
index-url = https://pypi.tuna.tsinghua.edu.cn/simple
[install]
trusted-host = https://pypi.tuna.tsinghua.edu.cn

推荐阅读:
  1. linux中怎么把pip改成国内镜像源
  2. pip被墙,修改国内源方法

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

pip 镜像源

上一篇:Spring[01.基础知识整理(上)]

下一篇:Travis CI eval ./gradlew assemble 错误

相关阅读

您好,登录后才能下订单哦!

密码登录
登录注册
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》