meinheld-gunicorn-docker
meinheld-gunicorn-docker copied to clipboard
Error `Error: class uri 'egg:meinheld#gunicorn_worker' invalid or not found`
I get this error when running the container. My application fails to start. I guessed it was greenlet, so I reverted back to version 0.4.17, but still the same issue.
See complete error
api_1 | Error: class uri 'egg:meinheld#gunicorn_worker' invalid or not found:
api_1 |
api_1 | [Traceback (most recent call last):
api_1 | File "/usr/local/lib/python3.8/site-packages/gunicorn/util.py", line 72, in load_class
api_1 | return pkg_resources.load_entry_point(dist, section, name)
api_1 | File "/usr/local/lib/python3.8/site-packages/pkg_resources/__init__.py", line 473, in load_entry_point
api_1 | return get_distribution(dist).load_entry_point(group, name)
api_1 | File "/usr/local/lib/python3.8/site-packages/pkg_resources/__init__.py", line 2843, in load_entry_point
api_1 | return ep.load()
api_1 | File "/usr/local/lib/python3.8/site-packages/pkg_resources/__init__.py", line 2446, in load
api_1 | self.require(*args, **kwargs)
api_1 | File "/usr/local/lib/python3.8/site-packages/pkg_resources/__init__.py", line 2469, in require
api_1 | items = working_set.resolve(reqs, env, installer, extras=self.extras)
api_1 | File "/usr/local/lib/python3.8/site-packages/pkg_resources/__init__.py", line 775, in resolve
api_1 | raise VersionConflict(dist, req).with_context(dependent_req)
api_1 | pkg_resources.VersionConflict: (greenlet 1.0.0 (/usr/local/lib/python3.8/site-packages), Requirement.parse('greenlet<0.5,>=0.4.5'))
api_1 | ]
Thanks
Have the same issue here!
Had the same issue and installing greenlet in version 0.4.17 at the end of my dockerfile fixed it for me. Now it's running again. Looking into this later maybe gonna find a better way
COPY ./requirements.txt /requirements.txt
RUN pip install --upgrade pip
RUN pip install -r /requirements.txt
RUN pip install greenlet==0.4.17
Greetings
That worked for me, thanks a lot @NoirPi
If your application requires a package like SQLAlchemy (sqlalchemy 1.4.17 has requirement greenlet!=0.4.17) this solution is not working. This image is probably not compatible with a lot of application due to the strict meinheld
requirement on greenlet
version: meinheld 1.0.2 requires greenlet<0.5,>=0.4.5
. You need to test all your modules and fix dependency versions in an exact version list, that is why people coming from C/C++ are surprised about how much fragility there is in the Python environments.
Not a solution but at least a workaround, sqlalchemy = "==1.4.18"
and greenlet = "==0.4.16"
does it for me.
As the time of today, the workaround I found to solve the issue is to add RUN pip install --no-cache-dir -U meinheld
right after the intallation of your requirements.txt (which contains SQLAlchemy)
It works for me with SQLAlchemy==1.4.26
on python 3.7