【问题标题】:Get error when try to install PIL [duplicate]尝试安装 PIL 时出错 [重复]
【发布时间】:2017-05-10 15:09:42
【问题描述】:

我尝试安装 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

【问题讨论】:

  • 什么系统?在 Linux Mint 上,您可以使用 apt-get 安装 python-pilpython-pillow

标签: python installation python-imaging-library


【解决方案1】:

您可以尝试改用Pillow,这是一个 PIL 分叉:

pip install Pillow

要导入使用:

from PIL import Image

【讨论】:

【解决方案2】:

PIL 位于Pillow。试试这个:

$ pip install Pillow

【讨论】:

    【解决方案3】:

    不确定是否有比这更好的方法。但这可能会按照文档中的说明工作:

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

    下载源码包并解压。提取后,按照工具包中的说明执行以下操作。

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

    【讨论】:

    • 在 _imagingtk.c:19 包含的文件中:/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/tk .h:78:11: 致命错误: 'X11/Xlib.h' 文件未找到 # 包含 ^ 1 个错误生成。错误:命令“cc”失败,退出状态为 1
    • 看看这里有没有解决问题的办法。 stackoverflow.com/questions/11465258/…
    猜你喜欢
    • 1970-01-01
    • 2015-07-03
    • 2017-11-07
    • 2011-02-27
    • 2021-12-26
    • 2020-12-24
    • 2021-03-16
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多