Pillow: pip install fails with syntax error

Created on 17 Mar 2020  路  5Comments  路  Source: python-pillow/Pillow

What did you do?

$ pip install Pillow

What did you expect to happen?

Successful installation of the package.

What actually happened?

$ pip install Pillow
Downloading/unpacking Pillow
  Downloading Pillow-7.0.0.tar.gz (38.2MB): 38.2MB downloaded
  Running setup.py (path:/tmp/pip-build-qFzZBw/Pillow/setup.py) egg_info for package Pillow
    Traceback (most recent call last):
      File "<string>", line 17, in <module>
      File "/tmp/pip-build-qFzZBw/Pillow/setup.py", line 304
        yield from self.features
                 ^
    SyntaxError: invalid syntax
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):

  File "<string>", line 17, in <module>

  File "/tmp/pip-build-qFzZBw/Pillow/setup.py", line 304

    yield from self.features

             ^

SyntaxError: invalid syntax

----------------------------------------
Cleaning up...

What are your OS, Python and Pillow versions?

  • OS: Debian Jessie
  • Python: 2.7
  • Pillow: 7.0.0

Most helpful comment

What version of pip are you using? With modern pip (9+), it should automatically pick the right version for you.

pip --version
pip install -U pip
pip install pillow

All 5 comments

https://pillow.readthedocs.io/en/stable/releasenotes/7.0.0.html

Pillow 7 dropped support for Python 2.7. If you would like to use Pillow 7, please switch to at least Python 3.5 - https://pillow.readthedocs.io/en/stable/installation.html. If you would like to continue to use Python 2.7, downgrade to Pillow 6.2.2.

What version of pip are you using? With modern pip (9+), it should automatically pick the right version for you.

pip --version
pip install -U pip
pip install pillow

Good to know, thanks!

What version of pip are you using? With modern pip (9+), it should automatically pick the right version for you.

Modern being the issue for me. I need to use Debian 8. Yes, after End-Of-Life. sigh

Good point about the pip version being maybe too old and not so smart. I have pip 8. I need to install something in a Python 2.7 environment that depends on Pillow 6, yet pip insists on using Pillow 7 and it fails. Luckily one can go through all errors and tell pip to install specific things by listing all packages with their desired versions (that still work with Python 2.7) in the same pip command, e.g.,

pip install numpy==1.7.1 scipy==0.18 pillow==6

Was this page helpful?
0 / 5 - 0 ratings

Related issues

damianmoore picture damianmoore  路  4Comments

HansHirse picture HansHirse  路  3Comments

thinrhino picture thinrhino  路  3Comments

readyready15728 picture readyready15728  路  4Comments

steph-ben picture steph-ben  路  4Comments