安装PIL库的时候出错:
ERROR: Exception: Traceback (most recent call last): File
“e:_software\pycharmprojects\lab06\venv\lib\site-packages\pip_vendor\resolvelib
\resolvers.py”, line 171, in _merge_into_criterion
crit = self.state.criteria[name] KeyError: ‘pillow’ During handling of the above exception, another exception occurred:

报错原因:
**
结果发现是网络原因,这种报错是因为下载外网资源网速太慢了!!**
解决方案
只需切换到国内安装镜像即可,这里我用的是清华的镜像:
pip install [需要安装的库] -i https://pypi.tuna.tsinghua.edu.cn/simple
**
我安装PIL的语句:
**
pip install opencv-python -i https://pypi.tuna.tsinghua.edu.cn/simple

成功啦~

本文解决Python环境下PIL库安装失败的问题,由于网络原因导致下载缓慢而出现错误。通过使用清华镜像源,成功安装PIL。

1万+

被折叠的 条评论
为什么被折叠?



