我是芹菜的新手,我遵循他们网站上的教程,我犯了这个错误。
from celery import Celery
app = Celery('tasks', broker='pyamqp://guest@localhost//')
@app.task
def add(x, y):
return x + ycmd显示如下错误
-------------- celery@DESKTOP-O90R45G v4.0.2 (latentcall)
---- **** -----
--- * *** * -- Windows-10-10.0.14393 2016-12-16 20:05:48
-- * - **** ---
- ** ---------- [config]
- ** ---------- .> app: tasks:0x4591950
- ** ---------- .> transport: amqp://guest:**@localhost:5672//
- ** ---------- .> results: disabled://
- *** --- * --- .> concurrency: 4 (prefork)
-- ******* ---- .> task events: OFF (enable -E to monitor tasks in this worker)
--- ***** ----- -------------- [queues]
.> celery exchange=celery(direct) key=celery
[tasks] . tasks.add
[2016-12-16 20:05:49,029: CRITICAL/MainProcess] Unrecoverable error:
TypeError('argument 1 must be an integer, not _subprocess_handle',)
Traceback (most recent call last): File
"c:\python27\lib\site-packages\celery\worker\worker.py", line 203, in
start
self.blueprint.start(self) File "c:\python27\lib\site-packages\celery\bootsteps.py", line 119, in
start
step.start(parent) File "c:\python27\lib\site-packages\celery\bootsteps.py", line 370, in
start
return self.obj.start() File "c:\python27\lib\site-packages\celery\concurrency\base.py", line 131,
in start
self.on_start() File "c:\python27\lib\site-packages\celery\concurrency\prefork.py", line
112, in on_start
**self.options) File "c:\python27\lib\site-packages\billiard\pool.py", line 1008, in
__init__
self._create_worker_process(i) File "c:\python27\lib\site-packages\billiard\pool.py", line 1117, in
_create_worker_process
w.start() File "c:\python27\lib\site-packages\billiard\process.py", line 122, in
start
self._popen = self._Popen(self) File "c:\python27\lib\site-packages\billiard\context.py", line 383, in
_Popen
return Popen(process_obj) File "c:\python27\lib\site-packages\billiard\popen_spawn_win32.py", line
64, in __init__
_winapi.CloseHandle(ht) TypeError: argument 1 must be an integer, not _subprocess_handle Traceback (most recent call last): File
"<string>", line 1, in <module> File
"c:\python27\lib\site-packages\billiard\spawn.py", line 159, in
spawn_main
new_handle = steal_handle(parent_pid, pipe_handle) File "c:\python27\lib\site-packages\billiard\reduction.py", line 126, in
steal_handle
_winapi.DUPLICATE_SAME_ACCESS | _winapi.DUPLICATE_CLOSE_SOURCE) >WindowsError: [Error 6] The handle is invalid发布于 2017-07-10 13:19:52
芹菜从4.0开始就不再支持了,就像他们的自述中所说的
芹菜是一个资金很少的项目,所以我们不支持微软Windows。请不要打开任何与该平台相关的问题。
不幸的是,这个bug似乎是副作用之一(对过程句柄的支持已被删除)。
你最好的办法是降低芹菜的档次,然后先去掉它:pip install celery==3.1.18
发布于 2017-07-09 06:48:30
看来你的rabbitmq服务器没在运行。您运行、安装和启动了拉比服务器吗?
您可以结帐rabbitmq文档并安装它。启动rabbitmq服务器,然后使用应用程序启动芹菜工人。
celery worker -l info -A taskshttps://stackoverflow.com/questions/41186960
复制相似问题