Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Syntax error installing gunicorn

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?

like image 747
Javi Avatar asked Sep 01 '14 18:09

Javi


1 Answers

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.

like image 100
Martijn Pieters Avatar answered Oct 03 '22 19:10

Martijn Pieters