meinheld-gunicorn-docker icon indicating copy to clipboard operation
meinheld-gunicorn-docker copied to clipboard

Error `Error: class uri 'egg:meinheld#gunicorn_worker' invalid or not found`

Open casoetan opened this issue 3 years ago • 6 comments

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

casoetan avatar Feb 04 '21 14:02 casoetan

Have the same issue here!

ysde avatar Mar 10 '21 14:03 ysde

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

NoirPi avatar Apr 09 '21 13:04 NoirPi

That worked for me, thanks a lot @NoirPi

ericboucher avatar Apr 25 '21 23:04 ericboucher

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.

MiltiadisKoutsokeras avatar Jun 09 '21 08:06 MiltiadisKoutsokeras

Not a solution but at least a workaround, sqlalchemy = "==1.4.18" and greenlet = "==0.4.16" does it for me.

DazEdword avatar Jun 21 '21 17:06 DazEdword

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

alessandropolverino avatar Nov 13 '21 20:11 alessandropolverino