python配置pip国内镜像源 以及自己遇到的问题

python如何配置pip国内镜像源

不换源的话要下载的是国外的一般网速会很慢很慢,几十kb,建议更改为国内镜像源如清华、中科大、豆瓣、阿里等

具体操作如下:
打开文件夹,系统盘–>用户文件夹–>电脑用户名文件夹–>新建一个文件夹,命名为pip --> 新建一个txt文件也命名为pip

如图:
在这里插入图片描述
在这里插入图片描述

在这里插入图片描述

!!!
注意:在txt文件中输入如下内容并将后缀改为.ini
复制代码框里的内容即可(此处为自己用的清华源)

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

尝试使用一下,win+R,输入cmd打开命令框,在命令框下个任意版本的numpy
在这里插入图片描述
成功了、、、、、、
如此一来,就不必在每次下载都要加上指定国内源的指令如:
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple pandas

pip install -i https://pypi.tuna.tsinghua.edu.cn/simple pandas

pandas处为你想下载的包,这是临时转换源的方法,每次都要加上前面的那串。

下面是一些国内源在pip.ini内输入小汇总:

清华大学:

[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

通常用清华的就够了



自己遇到的问题
ERROR: Could not find a version that satisfies the requirement 1.19.4 (from versions: none)
ERROR: No matching distribution found for 1.19.4
在这里插入图片描述
一开始以为源没用,但一连换了三个还是没用,最后发现,命令格式写错了。。。。。。。
在这里插入图片描述
如图所示,没写“ == ”。。。。
应该是 pip install numpy==1.19.4
而且 == 和 “numpy”和版本号之间也不要有空格

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

挥剑决浮云 -

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值