此问题已在此处有答案:
pip install PIL fails(5个答案)
16小时前关闭
当我尝试将PIL安装到我的pyCharm项目时,我得到以下错误:
ERROR: Could not find a version that satisfies the requirement PIL (from versions: none)
ERROR: No matching distribution found for PIL
WARNING: You are using pip version 21.3.1; however, version 23.1.2 is available.
You should consider upgrading via the 'C:\Users\fooBar\PycharmProjects\pythonProject8\venv\Scripts\python.exe -m pip install --upgrade pip' command.
当我这样做时,shell输出是
Requirement already satisfied: pip in c:\users\fooBar\anaconda3\lib\site-packages (23.1.2)
但是在安装PIL的时候也出现了同样的错误,所以我尝试在pyCharm中删除pip(21.3.1)并重新安装,成功安装了pip 23.1.2。但是当我重试PIL安装时,我得到此错误
ERROR: Could not find a version that satisfies the requirement PIL (from versions: none)
ERROR: No matching distribution found for PIL
2条答案
按热度按时间pcrecxhr1#
包
PIL
不再存在。您需要安装软件包
pillow
,它最初是PIL
的一个分支。您需要执行
pip install pillow
,或者直接通过IDE将其安装到正确的venv中。这仍然会给您提供python模块PIL
k10s72fa2#
与@FlyingTeller一样,
PIL
最初由Fredrik Lundh编写,是Python 2编程语言的原始包,用于图像处理(这就是为什么它的全名是'Python Image Library')。然而,由于对Python版本2的支持被删除,PIL
随后被删除。相反,您应该使用以下shell代码:
然后,当在项目中执行import语句时,只需编写
有关详细信息,请参阅枕头文档(https://pillow.readthedocs.io/en/stable/)。