python报错:Could not install packages due to an EnvironmentError: [WinError 5] 拒绝访问。

一、问题描述

python更新依赖后,报错

Requirement already satisfied: colorama; platform_system == "Windows" in c:\programdata\anaconda3\lib\site-packages (from tqdm<5.0.0,>=4.42.1->pyppeteer>=0.0.25->pyecharts-snapshot->-r .\requirements.txt (line 12)) (0.4.1)
pyppeteer 1.0.2 has requirement certifi>=2021, but you'll have certifi 2018.11.29 which is incompatible.
pyppeteer 1.0.2 has requirement importlib-metadata>=1.4, but you'll have importlib-metadata 0.6 which is incompatible.
pyppeteer 1.0.2 has requirement urllib3<2.0.0,>=1.25.8, but you'll have urllib3 1.24.1 which is incompatible.
Installing collected packages: openpyxl, tablib, records, prettytable, simplejson, pyecharts, tqdm, appdirs, pyee, websockets, pyppeteer, pyecharts-snapshot
  Found existing installation: openpyxl 2.5.12
    Uninstalling openpyxl-2.5.12:
Could not install packages due to an EnvironmentError: [WinError 5] 拒绝访问。: 'c:\\programdata\\anaconda3\\lib\\site-packages\\openpyxl-2.5.12.dist-info\\installer'
Consider using the `--user` option or check the permissions.

在这里插入图片描述

二、问题修复

1.直接运行

python -m pip install --upgrade pip --user


PS > python -m pip install --upgrade pip --user
Collecting pip

  Using cached https://files.pythonhosted.org/packages/09/bd/2410905c76ee14c62baf69e3f4aa780226c1bbfc9485731ad018e35b0cb5/pip-22.3.1-py3-none-any.whl
  
Installing collected packages: pip

  The script pip3.10.exe is installed in 'C:\Users\...\Python37\Scripts' which is not on PATH.
  







  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
Successfully installed pip-22.3.1

2.然后执行

添加–user

#添加 --user参数


pip install --user -r .\requirements.txt
  • 2
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值