【发布时间】:2017-07-19 08:40:48
【问题描述】:
我正在尝试通过 pip 在我的 RedHat 操作系统中安装 Pillow
sudo pip install Pillow
但是,我收到以下错误
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
我该如何解决这个问题?
谢谢
【问题讨论】:
-
要么安装支持 Python 2.6 的旧 Pillow 版本,要么升级 Python 解释器。
-
首先做
pip install --upgrade pip -
请参阅pillow.readthedocs.io/en/4.2.x/installation.html#notes 了解版本对,页面最底部会介绍如何访问旧版下载。
-
我已经将python升级到2.7.5,但是问题依旧存在。是否有可能运行的是旧版本而不是更新版本?如果有,如何解决?
标签: python pip python-imaging-library redhat pillow