安装gunicorn的语法错误

时间:2014-09-01 18:17:50

标签: python heroku gunicorn

我正在关注这个Heroku教程:https://devcenter.heroku.com/articles/getting-started-with-python-o当我尝试在virtualenv中安装gunicorn时,我收到此错误:

(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...

但是,当我运行$ foreman start时,它似乎正常工作。

这个错误有多重要?知道怎么解决吗?

1 个答案:

答案 0 :(得分:74)

可以忽略错误,您的gunicorn软件包已成功安装。

该错误是由一些只能在Python 3.3或更新版本上运行的代码抛出的,但Gunicorn支持的旧版本的Python不会使用它。

请参阅https://github.com/benoitc/gunicorn/issues/788

  

错误是安装期间发生的语法错误。这是无害的。

在安装过程中,setup.py脚本会尝试收集要安装的所有文件,并将它们编译为.pyc bytecache文件。一个仅在Python 3.3或更高版本上使用的文件包含在此文件中,并且该文件的编译失败。

有问题的文件增加了对aiohttp http client/server package的支持,它只适用于Python 3.3及更高版本。因此,您可以完全忽略此错误。

相关问题