Gabriel Pacheco
Gabriel Pacheco

Reputation: 309

ModuleNotFoundError: No module named 'geventwebsocket'

Can't run my web-socket site on Heroku cloud with gunicorn. Locally ('heroku local') its working fine, but when i try to acess my site URL it gets crashed.

Logs:

2018-07-18T20:45:32.563241+00:00 app[web.1]: Error: class uri 'geventwebsocket.gunicorn.workers.GeventWebSocketWorker' invalid or not found:

2018-07-18T20:45:32.563242+00:00 app[web.1]:

2018-07-18T20:45:32.563244+00:00 app[web.1]: [Traceback (most recent call last):

2018-07-18T20:45:32.563246+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/util.py", line 132, in load_class

2018-07-18T20:45:32.563247+00:00 app[web.1]: mod = import('.'.join(components))

2018-07-18T20:45:32.563249+00:00 app[web.1]: ModuleNotFoundError: No module named 'geventwebsocket'

2018-07-18T20:45:32.563250+00:00 app[web.1]: ]

Upvotes: 5

Views: 5907

Answers (2)

Владислав
Владислав

Reputation: 13

I had the same issue. If problem not in gevent-websocket, then probably you installed gunicorn with apt, try also installing with pip:

pip install gunicorn

If you're working under virtual environment, deactivate and activate again.

deactivate
conda activate <env-name>

or (Linux)

deactivate
source path/to/venv/bin/activate

or (Windows)

deactivate
path\to\venv\Scripts\activate

Upvotes: 0

ntg
ntg

Reputation: 14095

The package name is as mentioned gevent-websocket, so it's

conda activate <env-name>
conda install gevent-websocket

or

pip install gevent-websocket

depending if you use anaconda or not.

Upvotes: 4

Related Questions