benoitc / gunicorn

gunicorn 'Green Unicorn' is a WSGI HTTP Server for UNIX, fast clients and sleepy applications.
http://www.gunicorn.org
Other
9.7k stars 1.74k forks source link

Module geventwebsocket Not Found Using Gunicorn3 #2287

Closed ecda909 closed 4 weeks ago

ecda909 commented 4 years ago

Hi, I'm running gunicorn on my prod server using Ubuntu 18.04 and I'm running with the following:

gunicorn3 -b 0.0.0.0:8080 -k geventwebsocket.gunicorn.workers.GeventWebSocketWorker -w 1 app:app

If I use just:

gunicorn -b 0.0.0.0:8080 -k geventwebsocket.gunicorn.workers.GeventWebSocketWorker -w 1 app:app

Everything works fine, but it's only with Gunicorn3 that I see the error:

`Error: class uri 'geventwebsocket.gunicorn.workers.GeventWebSocketWorker' invalid or not found:

[Traceback (most recent call last): File "/usr/lib/python3/dist-packages/gunicorn/util.py", line 134, in load_class mod = import_module('.'.join(components)) File "/usr/lib/python3.6/importlib/init.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "", line 971, in _find_and_load File "", line 941, in _find_and_load_unlocked File "", line 219, in _call_with_frames_removed File "", line 994, in _gcd_import File "", line 971, in _find_and_load File "", line 941, in _find_and_load_unlocked File "", line 219, in _call_with_frames_removed File "", line 994, in _gcd_import File "", line 971, in _find_and_load File "", line 953, in _find_and_load_unlocked ModuleNotFoundError: No module named 'geventwebsocket' ]`

I think this is an error that should be addressed if not already.

hemna commented 1 year ago

I am hitting this as well

└─> gunicorn -k geventwebsocket.unicorn.workers.GeventWebSocketWorker --reload -w 1 aprsd.flask:app --log-level DEBUG

Error: class uri 'geventwebsocket.unicorn.workers.GeventWebSocketWorker' invalid or not found:

[Traceback (most recent call last):
  File "/Users/i530566/devel/mine/hamradio/aprsd/.aprsd-venv/lib/python3.10/site-packages/gunicorn/util.py", line 99, in load_class
    mod = importlib.import_module('.'.join(components))
  File "/Users/i530566/.pyenv/versions/3.10.9/lib/python3.10/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 992, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1004, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'geventwebsocket.unicorn'
]

╭─aprsd on  oslo-config [$!?] via 🐍 v3.10.9 (.aprsd-venv) ❯
└─> gunicorn --version
gunicorn (version 20.1.0)
╭─aprsd on  oslo-config [$!?] via 🐍 v3.10.9 (.aprsd-venv) ❯
└─> pip freeze |grep gevent
gevent==22.10.2
gevent-websocket==0.10.1
benoitc commented 4 weeks ago

no activity since awhile. closing feel free to create a new ticket if needed.