Get error when try to install PIL [duplicate]

吃可爱长大的小学妹 提交于 2020-08-01 05:25:07

问题


I try to install PIL but get errors, what should I do?

$ 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

回答1:


You could try using Pillow instead, which is a PIL fork:

pip install Pillow

To import use:

from PIL import Image



回答2:


The library PIL is in Pillow. Try this:

$ pip install Pillow



回答3:


Not sure if there is a better way than this. But this may work as described in the documentation:

http://www.pythonware.com/products/pil/.

Download the source kit and extract it. Once extracted, do the following as described in the kit.

    $ tar xvfz Imaging-1.1.7.tar.gz
    $ cd Imaging-1.1.7
    $ python setup.py install


来源:https://stackoverflow.com/questions/41326387/get-error-when-try-to-install-pil

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!