After Changing Python Version 3.6 to 3.10 I got cannot import name 'Callable' from 'collections'
Question:
File "C:UsersCodertjayPycharmProjectsTeems_App_Kidteems_app_kid__init__.py", line 5, in <module>
from .celery import app as celery_app File "C:UsersCodertjayPycharmProjectsTeems_App_Kidteems_app_kidcelery.py", line 3, in <module>
from celery import Celery File "C:UsersCodertjayPycharmProjectsbrownieTeems_App_Kidlibsite-packagesceleryfive.py", line 306, in __getattr__
module = __import__(self._object_origins[name], None, None, [name]) File "C:UsersCodertjayPycharmProjectsbrownieTeems_App_Kidlibsite-packagesceleryapp__init__.py", line 14, in <module>
from celery import _state File "C:UsersCodertjayPycharmProjectsbrownieTeems_App_Kidlibsite-packagescelery_state.py", line 20, in <module>
from celery.utils.threads import LocalStack File "C:UsersCodertjayPycharmProjectsbrownieTeems_App_Kidlibsite-packagesceleryutils__init__.py", line 20, in <module>
from collections import Callable ImportError: cannot import name 'Callable' from 'collections' (C:UsersCodertjayAppDataLocalProgramsPythonPython310libcollections__init__.py)
Answers:
The offending line has been removed from Celery nearly 6 years ago. You should update the celery package to a recent version.
I fixed the issue by changing celery to version 5.2 above and it started working
thanks a lot
This worked for me on M1 Mac and python 3.11
pip install celery==5.2.7
File "C:UsersCodertjayPycharmProjectsTeems_App_Kidteems_app_kid__init__.py", line 5, in <module>
from .celery import app as celery_app File "C:UsersCodertjayPycharmProjectsTeems_App_Kidteems_app_kidcelery.py", line 3, in <module>
from celery import Celery File "C:UsersCodertjayPycharmProjectsbrownieTeems_App_Kidlibsite-packagesceleryfive.py", line 306, in __getattr__
module = __import__(self._object_origins[name], None, None, [name]) File "C:UsersCodertjayPycharmProjectsbrownieTeems_App_Kidlibsite-packagesceleryapp__init__.py", line 14, in <module>
from celery import _state File "C:UsersCodertjayPycharmProjectsbrownieTeems_App_Kidlibsite-packagescelery_state.py", line 20, in <module>
from celery.utils.threads import LocalStack File "C:UsersCodertjayPycharmProjectsbrownieTeems_App_Kidlibsite-packagesceleryutils__init__.py", line 20, in <module>
from collections import Callable ImportError: cannot import name 'Callable' from 'collections' (C:UsersCodertjayAppDataLocalProgramsPythonPython310libcollections__init__.py)
The offending line has been removed from Celery nearly 6 years ago. You should update the celery package to a recent version.
I fixed the issue by changing celery to version 5.2 above and it started working
thanks a lot
This worked for me on M1 Mac and python 3.11
pip install celery==5.2.7