Unable to Start Celery worker instance : Syntax error
Traceback (most recent call last):
File "c:\users\darkchoco\appdata\local\programs\python\python39\lib\runpy.py", line 197, in _run_module_as_main
return _run_code(code, main_globals, None,
File "c:\users\darkchoco\appdata\local\programs\python\python39\lib\runpy.py", line 87, in _run_code
exec(code, run_globals)
File "C:\Users\Darkchoco\AppData\Local\Programs\Python\Python39\Scripts\celery.exe\__main__.py", line 7, in <modu
le>
File "c:\users\darkchoco\appdata\local\programs\python\python39\lib\site-packages\celery\__main__.py", line 28, i
n main
maybe_patch_concurrency()
File "c:\users\darkchoco\appdata\local\programs\python\python39\lib\site-packages\celery\__init__.py", line 130,
in maybe_patch_concurrency
concurrency.get_implementation(pool)
File "c:\users\darkchoco\appdata\local\programs\python\python39\lib\site-packages\celery\concurrency\__init__.py"
, line 29, in get_implementation
return symbol_by_name(cls, ALIASES)
File "c:\users\darkchoco\appdata\local\programs\python\python39\lib\site-packages\kombu\utils\__init__.py", line
96, in symbol_by_name
module = imp(module_name, package=package, **kwargs)
File "c:\users\darkchoco\appdata\local\programs\python\python39\lib\importlib\__init__.py", line 127, in import_m
odule
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 790, in exec_module
File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
File "c:\users\darkchoco\appdata\local\programs\python\python39\lib\site-packages\celery\concurrency\eventlet.py"
, line 33, in <module>
from celery.utils import timer2 # noqa
File "c:\users\darkchoco\appdata\local\programs\python\python39\lib\site-packages\celery\utils\timer2.py", line 1
9
from kombu.async.timer import Entry, Timer as Schedule, to_timestamp, logger
^
SyntaxError: invalid syntax
Well, its a known issue for Celery. Celery does not support python 3.7 yet. Same goes to Kombu. So downgrade python to 3.6 or former. You can check the status of that issue at https://github.com/celery/celery/issues/4500
原文链接:django - Unable to Start Celery worker instance : Syntax error - Stack Overflow