一、问题描述
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