nithish albin
nithish albin

Reputation: 61

heroku application error becaouse of gevent

when I try to push to Heroku its deploys correctly but shows application error. enter image description here

no updates are possible , log of heroku is following

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

2018-09-13T04:54:13.237928+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/gevent/init.py", line 41, in

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

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

2018-09-13T04:54:13.237932+00:00 app[web.1]: except Exception, ex:

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

2018-09-13T04:54:13.237934+00:00 app[web.1]: SyntaxError: invalid syntax

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

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

Upvotes: 1

Views: 439

Answers (1)

A. J. Parr
A. J. Parr

Reputation: 8026

Ok I see the problem, you are using Python 3 to run your Heroku application.

The line 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 specifically says you are using the Python 3.6 runtime, and the gevent library you are using is meant for Python 2. (The Exception is using Python 2 syntax)

Check the runtime.txt in your projects root folder and ensure it says "python-2.7.15", Heroku has docs on specifying the python runtime for your application https://devcenter.heroku.com/articles/python-runtimes.

Upvotes: 2

Related Questions