New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Celery Import Error #7783
Comments
Hey @marimuthuei 👋, We also offer priority support for our sponsors. |
What python version? Seems to occur only with python 3.7 #7784 |
Ok I guess because |
similar imports are failing (e.g. Tests with py3.8 and importlib-metadata works for me. |
its python3.7 env |
This seems to be the cause: python/importlib_metadata#405 Successfully installed importlib_metadata-4.13.0
$ python
Python 3.7.9 (default, Jul 5 2021, 22:17:33)
[GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from importlib_metadata import entry_points
>>> entry_points().get("celery.result_backends", list())
__main__:1: DeprecationWarning: SelectableGroups dict interface is deprecated. Use select.
[] So I guess we should fix celery/celery/utils/imports.py Lines 142 to 145 in 59263b0
|
The kombu package probably has the same problem |
Made a fix for celery (#7785) and kombu (celery/kombu#1601). |
|
@auvipy Can this issue will be resolved in celery ==4.4.7 version? |
nope |
As mentioned above, pinning to |
Hey guys, the PR associated with this issue introduced a bug and the documentation cannot be built. Please revert until a proper fix is available, we cannot have breaking code in |
https://readthedocs.org/projects/celery/builds/18287948/
But we capture AttributeError
So maybe you're looking at an old CI run? |
i have opened a revert pr, there the doc build is still failing, can you cross check please? |
Ah wait:
This is an error from kombu. So it won't pass until we release kombu (fixed in celery/kombu#1601). |
oh i see! a new beta of kombu should be released, I will do that |
#7834 testing |
Apart from kombu, it seems readthedocs was not using |
Thank you @woutdenolf for investigating this and coming up with a solution quickly! Appreciate it. Hope it will get merged soon :) |
@jaraco downgrading importlib_metadata didn't work for me :( In my case, I had a file that was called |
* Fix requires a new release of kombu - c.f. celery/celery#7783 (comment) - This should be viewed as temporary. As soon as there is a new release of kombu the release with this fix in in should get yanked in favor of a new release without this restriction. * Add lower bound of celery>=5.0.0.
importlib-metadata is not on later versions of python, so we can use a conditional pin. see # celery/celery#7783
* fix flakiness in publish retry tests not clear how this ever passed. it's unhelpfully tied to the kombu implementation which probably means it's a bad test, but just fixing it up for now * upgrade isort * rename whitelist -> allowlist * upgrade moto and pyjwt * bump requests to resolve conflict with boto * pyjwt requires you to specify algorithm now * upgrade urllib to resolve dependency tree * expected retries isn't flakey; depends on version of kombu * update import following deprecation, removes warning * pytest arg --strict renamed to --strict-markers * import sort * no cover pragmas for kombu version conditionals * pyjwt and moto require older versions on py2 * run docs on ubuntu 20.04; drop 3.6 from matrix * put 3.6 back and try all on 20.04 * drop 3.6 again * sort 5.12.0 not available on py3.7 * pin down jinja to a releaase that is still compatible with our old version of sphinx. it's not worth trying to upgrade sphinx because the new docs use mkdocs * importlib-metadata 5.0 is not compatible with latest kombu on py3.7 importlib-metadata is not on later versions of python, so we can use a conditional pin. see # celery/celery#7783 * upgrade pinned version of eventlet fixes https://stackoverflow.com/questions/75137717/eventlet-dns-python-attribute-error-module-dns-rdtypes-has-no-attribute-any * whoops; fix syntax in setup.py * oldest eventlet on py3.10 needs updating too * match "pinned" requests to the one in dev reqs also choose a version that works on all currently supported pythons * refactor conditional to avoid another pragma * copy/paste snafu * try running tests on ubuntu latest
* fix flakiness in publish retry tests not clear how this ever passed. it's unhelpfully tied to the kombu implementation which probably means it's a bad test, but just fixing it up for now * upgrade isort * rename whitelist -> allowlist * upgrade moto and pyjwt * bump requests to resolve conflict with boto * pyjwt requires you to specify algorithm now * upgrade urllib to resolve dependency tree * expected retries isn't flakey; depends on version of kombu * update import following deprecation, removes warning * pytest arg --strict renamed to --strict-markers * import sort * no cover pragmas for kombu version conditionals * pyjwt and moto require older versions on py2 * run docs on ubuntu 20.04; drop 3.6 from matrix * put 3.6 back and try all on 20.04 * drop 3.6 again * sort 5.12.0 not available on py3.7 * pin down jinja to a releaase that is still compatible with our old version of sphinx. it's not worth trying to upgrade sphinx because the new docs use mkdocs * importlib-metadata 5.0 is not compatible with latest kombu on py3.7 importlib-metadata is not on later versions of python, so we can use a conditional pin. see # celery/celery#7783 * upgrade pinned version of eventlet fixes https://stackoverflow.com/questions/75137717/eventlet-dns-python-attribute-error-module-dns-rdtypes-has-no-attribute-any * whoops; fix syntax in setup.py * oldest eventlet on py3.10 needs updating too * match "pinned" requests to the one in dev reqs also choose a version that works on all currently supported pythons * refactor conditional to avoid another pragma * copy/paste snafu * try running tests on ubuntu latest # Conflicts: # docs/examples/test/test_examples.py # nameko/cli/__init__.py # nameko/cli/utils/__init__.py # nameko/rpc.py # nameko/testing/pytest.py # test/amqp/test_publish.py
importlib_metadata package removed deprecated entry_point interfaces on version 5.0.0 [1] , and this change impacts celery >= 5.2.7 [2] running with python 3.7.X (it doesn't impact >= 3.8). For this reason, we control celery and importlib_metadata versions on python 3.7 environments. [1] python/importlib_metadata#405 [2] celery/celery#7783 Signed-off-by: Paulo Vital <paulo.vital@ibm.com>
importlib_metadata package removed deprecated entry_point interfaces on version 5.0.0 [1] , and this change impacts celery >= 5.2.7 [2] running with python 3.7.X (it doesn't impact >= 3.8). For this reason, we control celery and importlib_metadata versions on python 3.7 environments. [1] python/importlib_metadata#405 [2] celery/celery#7783 Signed-off-by: Paulo Vital <paulo.vital@ibm.com>
importlib_metadata package removed deprecated entry_point interfaces on version 5.0.0 [1] , and this change impacts celery >= 5.2.7 [2] running with python 3.7.X (it doesn't impact >= 3.8). For this reason, we control celery and importlib_metadata versions on python 3.7 environments. [1] python/importlib_metadata#405 [2] celery/celery#7783 Signed-off-by: Paulo Vital <paulo.vital@ibm.com>
Not able to import Celery module when creating simple app.
from celery import Celery
ImportError: cannot import name 'Celery' from 'celery'
Additonal info:
This issue doesn't occur when we downgrade importlib-metadata to 4.12.0
Env details
The text was updated successfully, but these errors were encountered: