python - 安装 gunicorn 的语法错误

标签 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 时,它似乎工作正常。

这个错误有多重要?知道如何解决吗?

最佳答案

错误可以忽略,你的gunicorn包安装成功。

该错误是由一些仅适用于 Python 3.3 或更高版本的代码引发的,但 Gunicorn 支持的旧 Python 版本不使用该代码。

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

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

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

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

关于python - 安装 gunicorn 的语法错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25611140/

相关文章:

python - 我将如何使用 php 在网页上显示多个按钮(它们将控制 raspberry pi)

python - 将峰彼此等距分开

database - Heroku:上线时要改变什么?

gunicorn - Airflow 的 Gunicorn 正在发送错误日志

DJango + nginx + gunicorn : how to stop caching

python - 导入 python 模块而不运行它

python - Pandas 滚动窗口似乎向滚动数据引入了偏移量

ruby-on-rails - Heroku Rails App 立即终止(SIGTERM)

ruby-on-rails - 如何在存储到 Rails 缓存(在 Heroku 上)之前加密缓存的值?

除根目录外的任何其他页面上的 django、nginx、gunicorn 404