由于gevent,heroku应用程序错误

问题描述 投票:1回答:1

当我尝试推送到Heroku时,它正确部署,但显示应用程序错误。 enter image description here

没有更新是可能的,heroku的日志正在跟随

2018-09-13T04:54:13.237927 + 00:00 app [web.1]:import

2018-09-13T04:54:13.237928 + 00:00 app [web.1]:文件“/app/.heroku/python/lib/python3.6/site-packages/gevent/init.py”,第41行,在

2018-09-13T04:54:13.237930 + 00:00 app [web.1]:来自gevent.hub import get_hub,iwait,wait

2018-09-13T04:54:13.237931 + 00:00 app [web.1]:文件“/app/.heroku/python/lib/python3.6/site-packages/gevent/hub.py”,第289行

2018-09-13T04:54:13.237932 + 00:00 app [web.1]:除了例外,例如:

2018-09-13T04:54:13.237933 + 00:00 app [web.1]:^

2018-09-13T04:54:13.237934 + 00:00 app [web.1]:SyntaxError:语法无效

2018-09-13T04:54:13.237936 + 00:00 app [web.1]:]

2018-09-13T04:54:13.237944 + 00:00 app [web.1]:

python django git heroku gevent
1个回答
2
投票

好的,我看到了问题,你使用Python 3来运行你的Heroku应用程序。

2018-09-13T04:54:13.237931+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/gevent/hub.py", line 289这一行明确表示你正在使用Python 3.6运行时,你正在使用的gevent库适用于Python 2.(Exception使用的是Python 2语法)

检查项目根文件夹中的runtime.txt并确保它显示为“python-2.7.15”,Heroku有关于为应用程序https://devcenter.heroku.com/articles/python-runtimes指定python运行时的文档。

© www.soinside.com 2019 - 2024. All rights reserved.