冯小囡
2021-06-07 10:12
在django项目中使用celeryCelery导入不进去
项目启动时报错如下:
Traceback (most recent call last):
File "D:/美多商城_admin/MeiDuo_Dj/manage.py", line 21, in <module>
main()
File "D:/美多商城_admin/MeiDuo_Dj/manage.py", line 17, in main
execute_from_command_line(sys.argv)
File "F:\Anaconda3.5\Anaconda3\envs\python36\lib\site-packages\django\core\management\__init__.py", line 381, in execute_from_command_line
utility.execute()
File "F:\Anaconda3.5\Anaconda3\envs\python36\lib\site-packages\django\core\management\__init__.py", line 375, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "F:\Anaconda3.5\Anaconda3\envs\python36\lib\site-packages\django\core\management\base.py", line 336, in run_from_argv
connections.close_all()
File "F:\Anaconda3.5\Anaconda3\envs\python36\lib\site-packages\django\db\utils.py", line 219, in close_all
for alias in self:
File "F:\Anaconda3.5\Anaconda3\envs\python36\lib\site-packages\django\db\utils.py", line 213, in __iter__
return iter(self.databases)
File "F:\Anaconda3.5\Anaconda3\envs\python36\lib\site-packages\django\utils\functional.py", line 80, in __get__
res = instance.__dict__[self.name] = self.func(instance)
File "F:\Anaconda3.5\Anaconda3\envs\python36\lib\site-packages\django\db\utils.py", line 147, in databases
self._databases = settings.DATABASES
File "F:\Anaconda3.5\Anaconda3\envs\python36\lib\site-packages\django\conf\__init__.py", line 79, in __getattr__
self._setup(name)
File "F:\Anaconda3.5\Anaconda3\envs\python36\lib\site-packages\django\conf\__init__.py", line 66, in _setup
self._wrapped = Settings(settings_module)
File "F:\Anaconda3.5\Anaconda3\envs\python36\lib\site-packages\django\conf\__init__.py", line 157, in __init__
mod = importlib.import_module(self.SETTINGS_MODULE)
File "F:\Anaconda3.5\Anaconda3\envs\python36\lib\importlib\__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 994, in _gcd_import
File "<frozen importlib._bootstrap>", line 971, in _find_and_load
File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 678, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "D:\美多商城_admin\MeiDuo_Dj\MeiDuo_Dj\settings.py", line 16, in <module>
import djcelery
File "F:\Anaconda3.5\Anaconda3\envs\python36\lib\site-packages\djcelery\__init__.py", line 34, in <module>
from celery import current_app as celery # noqa
ImportError: cannot import name 'current_app'
你先看一下导出的那儿,导出的方式是怎么样了,要对应导出与导入的方法
没有找到你的包
Python 异步任务队列 Celery 使用
10849 学习 · 43 问题
相似问题