celery
celery copied to clipboard
ValueError: not enough values to unpack (expected 3, got 0)
when i try execute func of firt celery func tast ,error founhd!!!!!!
my system win11 Python 3.11.5 celery==5.3.6 broker redis
celery_app.py
from celery import Celery import time app = Celery('celery_task') app.conf.broker_url = 'redis://192.168.1.139:6380/0' @app.task def hello(): print("hello world ") time.sleep(10) return
test.py
from celery_app import hello task = hello.delay()
print(task)
[2024-03-22 17:44:48,856: ERROR/MainProcess] Task handler raised error: ValueError('not enough values to unpack (expected 3, got 0)') billiard.einfo.RemoteTraceback: """ Traceback (most recent call last): File "C:\Users\renoy\anaconda3\envs\idp_backend\Lib\site-packages\billiard\pool.py", line 361, in workloop result = (True, prepare_result(fun(*args, **kwargs))) ^^^^^^^^^^^^^^^^^^^^ File "C:\Users\renoy\anaconda3\envs\idp_backend\Lib\site-packages\celery\app\trace.py", line 667, in fast_trace_task tasks, accept, hostname = _loc ^^^^^^^^^^^^^^^^^^^^^^^ ValueError: not enough values to unpack (expected 3, got 0) """
The above exception was the direct cause of the following exception:
I have the same issue as above mentioned Can anyone help me?
Have you resolved this issue?
Have you resolved this issue? no, but i try use ubuntu system , It didn't happen.
Have you resolved this issue? no, but i try use ubuntu system , It didn't happen.
这篇文章里有提到,在Windows
需要使用-P eventlet
启动。刚才试了一下,可以正常运行。
666666
I couldn't get celery to work, so I switched to Dramatiq
Have you resolved this issue? no, but i try use ubuntu system , It didn't happen.
这篇文章里有提到,在
Windows
需要使用-P eventlet
启动。刚才试了一下,可以正常运行。
Eventlet 不是 多进程 的,无法用于 需要大量CPU算力的并行任务。 还是需要用默认的 prefork 或 processes
Add code before initializing celery app.
os.environ['FORKED_BY_MULTIPROCESSING'] = '1'
see this blog: https://celery.school/celery-on-windows