首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >安装Pillow for Python的问题

安装Pillow for Python的问题
EN

Stack Overflow用户
提问于 2017-07-19 16:40:48
回答 2查看 1.9K关注 0票数 0

我正在尝试通过pip在我的RedHat操作系统中安装枕头。

代码语言:javascript
复制
sudo pip install Pillow

但是,我收到以下错误

代码语言:javascript
复制
You are using pip version 7.1.0, however version 9.0.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
Collecting Pillow
/usr/lib/python2.6/sitepackages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:90: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
  InsecurePlatformWarning
  Downloading Pillow-4.2.1.tar.gz (12.7MB)
    100% |\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588| 12.7MB 35kB/s 
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
  File "<string>", line 20, in <module>
  File "/tmp/pip-build-5XOfq_/Pillow/setup.py", line 143
    required = {'jpeg', 'zlib'}
                      ^
SyntaxError: invalid syntax

----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-5XOfq_/Pillow

我如何解决这个问题?

谢谢

EN

回答 2

Stack Overflow用户

发布于 2017-07-19 17:24:06

您得到的错误与Python2.7中引入的创建集合的新语法有关。

代码语言:javascript
复制
{item1, item2, ...}

您运行的Python版本似乎早于2.7,该版本不能识别这是有效的语法。

Pillow的网站包括notes on which versions of Pillow are compatible with which versions of Python。您需要升级Python (推荐),或者选择与您已有的Python版本兼容的旧版本的Pillow。

票数 1
EN

Stack Overflow用户

发布于 2018-03-30 02:30:48

http://prodiguer.github.io/synda/faq.html#transfer-module

这里是这样说的:

此错误会影响从源代码安装的3.6版本(RPM3.6和DEB3.6不应受影响)。该问题已在3.7中修复。它可以通过降级pypi枕头包在3.6中修复:

pip install pillow==3.4.2

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/45185280

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档