0

I am trying to install Pillow in my RedHat operating system through pip

sudo pip install Pillow

However, I receive the following error

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

How can I address this?

Thanks

4
  • Either install older Pillow version that supports Python 2.6 or upgrade Python interpreter. Commented Jul 19, 2017 at 8:41
  • First of all do pip install --upgrade pip
    – Ludisposed
    Commented Jul 19, 2017 at 8:59
  • See pillow.readthedocs.io/en/4.2.x/installation.html#notes for version-pairs, and the very bottom of the page tells about accessing older downloads.
    – tevemadar
    Commented Jul 19, 2017 at 9:20
  • I have upgraded the python to 2.7.5, but the issue still exists. Is it possible that the older version is running instead of the updated one? If so, how to fix it?
    – halahmadi
    Commented Jul 19, 2017 at 9:39

2 Answers 2

1

The error you're getting has to do with the new syntax for creating sets that was introduced in Python 2.7.

{item1, item2, ...}

It seems you're running a version of Python prior to 2.7, which doesn't recognize this as valid syntax.

Pillow's web site includes notes on which versions of Pillow are compatible with which versions of Python. You'll need to either upgrade Python (recommended), or choose an older version of Pillow which works with the Python version you have.

2
  • I have upgraded the python to 2.7.5, but the issue still exists. Is it possible that the older version is running instead of the updated one? If so, how to fix it?
    – halahmadi
    Commented Jul 19, 2017 at 9:40
  • That depends on how you upgraded it. One foolproof way to make the new version run is to uninstall the old version, if nothing on your system needs it. (Afterwards you might have to uninstall and reinstall the new version as well.) You can check which version is running using pip --version.
    – David Z
    Commented Jul 19, 2017 at 9:42
0

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

here says:

This bug affects 3.6 version installed from source (RPM 3.6 and DEB 3.6 should not be affected). It has been fixed in 3.7. It can be fixed in 3.6 by downgrading the pypi pillow package:

pip install pillow==3.4.2

Not the answer you're looking for? Browse other questions tagged or ask your own question.