zl程序教程

您现在的位置是:首页 >  后端

当前栏目

【Python问题解决】---- ERROR: Could not install packages due to an OSError: [WinError 5] 拒绝访问。

Python 问题 Error 解决 not to 访问 an
2023-06-13 09:13:36 时间

1. 报错

ERROR: Could not install packages due to an OSError: [WinError 5] 拒绝访问。: 'c:\\python310\\lib\\site-packages\\pip-22.2.2.dist-info\\entry_points.txt'
Consider using the `--user` option or check the permissions.

2. 报错截图

3. 报错原因

安装指定版本的pip时,报错!

python -m pip install pip==21.2

4. 错误分析

由于OSError,无法安装程序包,拒绝访问。考虑使用--user选项或检查权限。

5. 解决办法

  1. 使用管理身份运行cmd
  1. 重新安装指定版本的pip

6. 解决后查看pip版本

pip -V
  1. 解决前
  1. 解决后