python - 尝试安装 PIL 时出错

标签 python installation python-imaging-library

我尝试安装 PIL 但出现错误,我该怎么办?

$ Command
Result
------------
$ pip install PIL

Collecting PIL
  Could not find a version that satisfies the requirement PIL (from versions: )
No matching distribution found for PIL
--------------------------------------------------------------------
$ pip install PIL  --allow-unverified PIL --allow-all-external

DEPRECATION: --allow-all-external has been deprecated and will be removed in the future. Due to changes in the repository protocol, it no longer has any effect.
DEPRECATION: --allow-unverified has been deprecated and will be removed in the future. Due to changes in the repository protocol, it no longer has any effect.
Collecting PIL
  Could not find a version that satisfies the requirement PIL (from versions: )
No matching distribution found for PIL

最佳答案

您可以尝试使用 Pillow相反,这是一个 PIL fork :

pip install Pillow

导入使用:

from PIL import Image

关于python - 尝试安装 PIL 时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41326387/

相关文章:

python - 为什么我不能在 Python PIL 中裁剪此图像? (简单的语法问题?)

python - PIL.Image.fromarray 在 np.reshape 之后产生扭曲的图像

python - 名称错误 : global name 'NoneType' is not defined in Spark

python - 如何在 gtk 加速器中使用 'F' 键?

python - 有没有办法使用 stdout 或重定向的输出来运行 python 代码?

c++ - 窗口 : load a filter driver while windows is running

python - 如何将负 (<0) RGB 颜色值放入 PIL 中的图像?

python - pandas 按 n 秒分组并应用任意滚动功能

python - 安装并添加到 PATH 后,Windows 无法识别“nosetests”

go - 在 Windows 7 上通过 cgo 安装使用 SDL2 的包时出现问题