python使用pip安装一些包失败

python安装一些包的时候会出现失败,可以切换一下源,国内清华的源比较好用
1.一次使用
比如安装numpy
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple numpy
2.长期使用
修改用户文件夹下面的pip/pip.ini文件
在这里插入图片描述
内容修改为

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

也可以通过命令行的方式,效果相同
在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/rj2017211811/article/details/106442670
今日推荐