栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > Python

python pip设置国内镜像 解决下载库慢的问题

Python 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

python pip设置国内镜像 解决下载库慢的问题

打开文件夹,系统盘–>用户文件夹–>电脑用户名文件夹–>新建一个文件夹,命名为pip --> 新建一个txt文件也命名为pip
pip.txt文件改为pip.ini

pip.ini输入如下:

[global]
index-url = http://mirrors.aliyun.com/pypi/simple
[install]
trusted-host = mirrors.aliyun.com

大概意思是设置请求地址,然后信任host

有些旧的文档是写成这样的
trusted-host = https://pypi.tuna.tsinghua.edu.cn
会报

 所以要采用上述写法。
其他镜像源

清华大学:

[global]
index-url = https://pypi.tuna.tsinghua.edu.cn/simple
[install]
trusted-host = https://pypi.tuna.tsinghua.edu.cn

中科大:

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

[global]
index-url = http://mirrors.aliyun.com/pypi/simple
[install]
trusted-host = http://mirrors.aliyun.com/pypi

豆瓣:
[global]
index-url = http://pypi.douban.com/simple
[install]
trusted-host = http://pypi.douban.com
 

上面地址是摘抄的 rusted-host要记得修改一下
 

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/994725.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号