想安装 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/