我有最新的芹菜 4.4.4。当尝试以辅助角色身份运行它时,它会出错。
$ .venv/bin/pip freeze
amqp==2.6.0
appnope==0.1.0
backcall==0.1.0
billiard==3.6.3.0
celery==4.4.4
decorator==4.4.2
importlib-metadata==1.6.0
ipython==7.15.0
ipython-genutils==0.2.0
jedi==0.17.0
kombu==4.6.10
parso==0.7.0
pexpect==4.8.0
pickleshare==0.7.5
prompt-toolkit==3.0.5
ptyprocess==0.6.0
Pygments==2.6.1
pytz==2020.1
six==1.15.0
traitlets==4.3.3
vine==1.3.0
wcwidth==0.2.3
zipp==3.1.0
我的维鲁塔伦夫中的包裹。
$ .venv/bin/celery worker
iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAYAAADDPmHLAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyhpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTExIDc5LjE1ODMyNSwgMjAxNS8wOS8xMC0wMToxMDoyMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9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PGbg6zTCbl5mb4NKTXNjsPkMczLedmSIKHJVnSEY04kqklNk4SmEbGzc0c21aAu+OB/QMTNB5oRU8glmV9jl278S31BEm3RuKJggTIkaBBUZVJRCOOFf0OG5285FnVF9yQQN92ELgZ53/p6s+kUj34iCjwHIFHYnVVbawy5uh4fIgGgY8V1APk8uyBj3pVr/dRWZVvIRoxmJbJJqd/Zr/9MUTjg+WkQ6s9Y6sHyOsNRrpe5jeUMNJGHDGJgedUHqmzEpX7ljTFH7a797Ocm0WXfLv4wZHuJ03DeJ1PL8cMY3FEgtVWdXnDbCRQHaD8/EWE78zt4rfoFZ6yLLObTzbl8w35lDPMOnK/VwgFys1osPZOwB9d9qshWZa1ED3vY4X+hxHgPh5k4i2AAAACAAgAIACAAAACAAgAIACAAAACAAgAIACAAAACAAgAIACAAAACAAgAIACAAAACAAgAIACAAAACAAgAIACAAAACAAgAIACAAAACAAgAIACAAAACgJ3EXwIMAFdh0F0D4bmIAAAAAElFTkSuQmCC
[2020-06-04 21:14:58,161: CRITICAL/MainProcess] Unrecoverable error: ModuleNotFoundError("No module named 'future'")
Traceback (most recent call last):
File "/Users/myuser/myprj/.venv/lib/python3.7/site-packages/kombu/utils/objects.py", line 42, in __get__
return obj.__dict__[self.__name__]
KeyError: 'backend'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/myuser/myprj/.venv/lib/python3.7/site-packages/celery/worker/worker.py", line 208, in start
self.blueprint.start(self)
File "/Users/myuser/myprj/.venv/lib/python3.7/site-packages/celery/bootsteps.py", line 115, in start
self.on_start()
File "/Users/myuser/myprj/.venv/lib/python3.7/site-packages/celery/apps/worker.py", line 139, in on_start
self.emit_banner()
File "/Users/myuser/myprj/.venv/lib/python3.7/site-packages/celery/apps/worker.py", line 154, in emit_banner
' n', self.startup_info(artlines=not use_image))),
File "/Users/myuser/myprj/.venv/lib/python3.7/site-packages/celery/apps/worker.py", line 217, in startup_info
results=self.app.backend.as_uri(),
File "/Users/myuser/myprj/.venv/lib/python3.7/site-packages/kombu/utils/objects.py", line 44, in __get__
value = obj.__dict__[self.__name__] = self.__get(obj)
File "/Users/myuser/myprj/.venv/lib/python3.7/site-packages/celery/app/base.py", line 1232, in backend
return self._get_backend()
File "/Users/myuser/myprj/.venv/lib/python3.7/site-packages/celery/app/base.py", line 949, in _get_backend
self.loader)
File "/Users/myuser/myprj/.venv/lib/python3.7/site-packages/celery/app/backends.py", line 74, in by_url
return by_name(backend, loader), url
File "/Users/myuser/myprj/.venv/lib/python3.7/site-packages/celery/app/backends.py", line 54, in by_name
cls = symbol_by_name(backend, aliases)
File "/Users/myuser/myprj/.venv/lib/python3.7/site-packages/kombu/utils/imports.py", line 57, in symbol_by_name
module = imp(module_name, package=package, **kwargs)
File "/Users/myuser/.pyenv/versions/3.7.4/lib/python3.7/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
File "<frozen importlib._bootstrap>", line 983, in _find_and_load
File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 728, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "/Users/myuser/myprj/.venv/lib/python3.7/site-packages/celery/backends/rpc.py", line 19, in <module>
from . import base
File "/Users/myuser/myprj/.venv/lib/python3.7/site-packages/celery/backends/base.py", line 10, in <module>
from future.utils import raise_with_traceback
ModuleNotFoundError: No module named 'future'
这是新版本4.4.4
中添加的新更改。如何解决这个问题?
显然这是一个 Celery 4.4.4 错误。您可以等到 4.4.5 发布(也许在您阅读本文时它已经出来了(,或者使用 4.4.3,或手动pip install future
.