我正在尝试通过pip在我的RedHat操作系统中安装枕头。
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我如何解决这个问题?
谢谢
发布于 2017-07-19 17:24:06
您得到的错误与Python2.7中引入的创建集合的新语法有关。
{item1, item2, ...}您运行的Python版本似乎早于2.7,该版本不能识别这是有效的语法。
Pillow的网站包括notes on which versions of Pillow are compatible with which versions of Python。您需要升级Python (推荐),或者选择与您已有的Python版本兼容的旧版本的Pillow。
发布于 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
https://stackoverflow.com/questions/45185280
复制相似问题