gpt4 book ai didi

python-3.x - 类型错误:在运行基本 add.delay(1,2) 测试时无法 pickle 内存 View 对象

转载 作者:行者123 更新时间:2023-12-03 19:30:06 24 4
gpt4 key购买 nike

尝试使用 celery 4.1.0 和 Python 3.6.4 运行 add.delay(1,2) 的最基本测试,并收到以下错误:

[2018-02-27 13:58:50,194: INFO/MainProcess] Received task: exb.tasks.test_tasks.add[52c3fb33-ce00-4165-ad18-15026eca55e9]
[2018-02-27 13:58:50,194: CRITICAL/MainProcess] Unrecoverable error: SystemError(' returned a result with an error set',) Traceback (most recent call last): File "/opt/myapp/lib/python3.6/site-packages/kombu/messaging.py", line 624, in _receive_callback return on_m(message) if on_m else self.receive(decoded, message) File "/opt/myapp/lib/python3.6/site-packages/celery/worker/consumer/consumer.py", line 570, in on_task_received callbacks, File "/opt/myapp/lib/python3.6/site-packages/celery/worker/strategy.py", line 145, in task_message_handler handle(req) File "/opt/myapp/lib/python3.6/site-packages/celery/worker/worker.py", line 221, in _process_task_sem return self._quick_acquire(self._process_task, req) File "/opt/myapp/lib/python3.6/site-packages/kombu/async/semaphore.py", line 62, in acquire callback(*partial_args, **partial_kwargs) File "/opt/myapp/lib/python3.6/site-packages/celery/worker/worker.py", line 226, in _process_task req.execute_using_pool(self.pool) File "/opt/myapp/lib/python3.6/site-packages/celery/worker/request.py", line 531, in execute_using_pool correlation_id=task_id, File "/opt/myapp/lib/python3.6/site-packages/celery/concurrency/base.py", line 155, in apply_async **options) File "/opt/myapp/lib/python3.6/site-packages/billiard/pool.py", line 1486, in apply_async self._quick_put((TASK, (result._job, None, func, args, kwds))) File "/opt/myapp/lib/python3.6/site-packages/celery/concurrency/asynpool.py", line 813, in send_job body = dumps(tup, protocol=protocol) TypeError: can't pickle memoryview objects

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "/opt/myapp/lib/python3.6/site-packages/celery/worker/worker.py", line 203, in start self.blueprint.start(self) File "/opt/myapp/lib/python3.6/site-packages/celery/bootsteps.py", line 119, in start step.start(parent) File "/opt/myapp/lib/python3.6/site-packages/celery/bootsteps.py", line 370, in start return self.obj.start() File "/opt/myapp/lib/python3.6/site-packages/celery/worker/consumer/consumer.py", line 320, in start blueprint.start(self) File "/opt/myapp/lib/python3.6/site-packages/celery/bootsteps.py", line 119, in start step.start(parent) File "/opt/myapp/lib/python3.6/site-packages/celery/worker/consumer/consumer.py", line 596, in start c.loop(*c.loop_args()) File "/opt/myapp/lib/python3.6/site-packages/celery/worker/loops.py", line 88, in asynloop next(loop) File "/opt/myapp/lib/python3.6/site-packages/kombu/async/hub.py", line 354, in create_loop cb(*cbargs) File "/opt/myapp/lib/python3.6/site-packages/kombu/transport/base.py", line 236, in on_readable reader(loop) File "/opt/myapp/lib/python3.6/site-packages/kombu/transport/base.py", line 218, in _read drain_events(timeout=0) File "/opt/myapp/lib/python3.6/site-packages/librabbitmq-2.0.0-py3.6-linux-x86_64.egg/librabbitmq/init.py", line 227, in drain_events self._basic_recv(timeout) SystemError: returned a result with an error set



我找不到任何以前任何人遇到此错误的证据。我从 celery 网站注意到只有 python 3.5 被提及为支持,这是问题还是我缺少的东西?

任何帮助将非常感激!

更新:尝试使用 Python 3.5.5,问题仍然存在。用 Django 4.0.2 试过,问题依旧。

更新:卸载 librabbitmq,问题停止。这是在从 Python 2.7.5、Django 1.7.7 迁移到 Python 3.6.4、Django 2.0.2 之后看到的。

最佳答案

卸载librabbitmq后,问题解决。

关于python-3.x - 类型错误:在运行基本 add.delay(1,2) 测试时无法 pickle 内存 View 对象,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49018923/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com