[祖传代码] 搞坏了 pip,用 easy_install 补救一下

想安装 kivy 试一下时,使用命令:

pip install --upgrade pip wheel setuptools

结果好像干掉了自己的pip脚本:
在这里插入图片描述
Installing collected packages: pip, wheel, setuptools
Found existing installation: pip 18.1
Uninstalling pip-18.1:
Could not install packages due to an EnvironmentError: [WinError 5] 拒绝访问。
‘d:\anaconda3\scripts\pip.exe’
Consider using the --user option or check the permissions.

再次运行更新命令,报错:
在这里插入图片描述
Script file ‘D:\Anaconda3\Scripts\pip-script.py’ is not present.

搜索报错内容,找到这篇博客提示可以使用 easy_install 安装 pip。

直接输入命令,报错:
在这里插入图片描述
Searching for pip
Reading https://pypi.org/simple/pip/
Download error on https://pypi.org/simple/pip/: unknown url type: https – Some
packages may not be found!

报错中有地址,联想到之前pip有“源”的概念,所以搜索 “easy_install 更改源”,找到这两篇博客,一篇告诉我如何更换源第二篇告诉我有哪些可用的源地址

根据上面两篇博客,记录一下换源的过程:easy_install的源地址写在他自己的脚本里,我用的是anaconda,所以 easy_install.py 脚本在

D:\Anaconda3\Lib\site-packages\setuptools\command

打开easy_install.py,找到 https://pypi.org/simple/pip 替换为
阿里云 http://mirrors.aliyun.com/pypi/simple/ (我用的)
中国科技大学 https://pypi.mirrors.ustc.edu.cn/simple/
豆瓣(douban) http://pypi.douban.com/simple/
清华大学 https://pypi.tuna.tsinghua.edu.cn/simple/
中国科学技术大学 http://pypi.mirrors.ustc.edu.cn/simple/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值