Python 更新pip报错:Could not install packages due to an EnvironmentError: [WinError 5] 拒绝访问

问题描述:

pip安装库文件时报错:You are using pip version 18.1, however version 21.0.1 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.

执行:

python -m pip install --upgrade pip

报错:
Could not install packages due to an EnvironmentError: [WinError 5] 拒绝访问。: 'C:\Program Files (x86)\Python37-32\Lib\site-packages\pip\init.py'
Consider using the --user option or check the permissions.
解决方法:

python -m pip install --upgrade pip -i https://pypi.douban.com/simple --user

加上 --user 给予权限搞定。这里用了豆瓣的源。别说还挺快。

完美解决!Successfully!

posted @ 2021-04-14 22:45  桃夭-ccdr  阅读(259)  评论(0编辑  收藏  举报