38

I am following this Heroku tutorial: https://devcenter.heroku.com/articles/getting-started-with-python-o and when I am trying to install gunicorn in a virtualenv I am getting this error:

(venv)jabuntu14@ubuntu:~/Desktop/helloflask$ pip install gunicorn
Downloading/unpacking gunicorn
Downloading gunicorn-19.1.1-py2.py3-none-any.whl (104kB): 104kB downloaded
Installing collected packages: gunicorn
Compiling /home/jabuntu14/Desktop/helloflask/venv/build/gunicorn/gunicorn/workers    /_gaiohttp.py ...
File "/home/jabuntu14/Desktop/helloflask/venv/build/gunicorn/gunicorn/workers    /_gaiohttp.py", line 64
    yield from self.wsgi.close()
         ^

SyntaxError: invalid syntax
Successfully installed gunicorn
Cleaning up...

However, when I run $foreman start it appears to work properly.

How important is this error? Any idea how to solve it?

3
  • 1
  • Thanks for the comment. I already saw that, however it is interesting that Heroku documentation says nothing about it. However, is that an important error that will cause me problems in the future? (Note: I am a beginner on this)
    – Javi
    Sep 1, 2014 at 18:24
  • 1
    No, it won't cause you issues in the future.
    – Martijn Pieters
    Sep 1, 2014 at 18:26

1 Answer 1

75

The error can be ignored, your gunicorn package installed successfully.

The error is thrown by a bit of code that'd only work on Python 3.3 or newer, but isn't used by older Python versions that Gunicorn supports.

See https://github.com/benoitc/gunicorn/issues/788:

The error is a syntax error happening during install. It is harmless.

During installation the setup.py script tries to collect all files to be installed, and compiles them to .pyc bytecache files. One file that is used only on Python 3.3 or up is included in this and the compilation for that one file fails.

The file in question adds support for the aiohttp http client/server package, which only works on Python 3.3 and up anyway. As such you can ignore this error entirely.

4
  • 18
    You'd think they'd catch that so as not to scare a bunch of innocent users, whether to print a message or just fail silently...
    – a p
    Dec 9, 2014 at 22:17
  • 1
    @ap: the setup.py pre-compilation stage is not something the setup has much influence over.
    – Martijn Pieters
    Dec 9, 2014 at 22:20
  • How can I test that gunicorn installed succesfully?
    – a06e
    Sep 3, 2015 at 13:22
  • 2
    @becko: it'll say Successfully installed gunicorn at the end.
    – Martijn Pieters
    Sep 3, 2015 at 13:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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