为了账号安全,请及时绑定邮箱和手机立即绑定

python manage.py celery worker -l INFO必报这个错

环境:python3.6+django.2.0,是不是Django 版本太高了, 我看视频用的1.8


[2018-12-18 15:04:36,822: WARNING/MainProcess] /Development/virtualenv_workspace/py36dj2/lib/python3.6/site-packages/billiard/__init__.py:321: RuntimeWarning: force_execv is not supported as the billiard C extension is not installed


  warnings.warn(RuntimeWarning(W_NO_EXECV))


[2018-12-18 15:04:37,099: INFO/MainProcess] Connected to redis://:**@127.0.0.1:6379/1


[2018-12-18 15:04:37,111: INFO/MainProcess] mingle: searching for neighbors


[2018-12-18 15:04:38,119: INFO/MainProcess] mingle: all alone


[2018-12-18 15:04:38,131: WARNING/MainProcess] /Development/virtualenv_workspace/py36dj2/lib/python3.6/site-packages/djcelery/loaders.py:133: UserWarning: Using settings.DEBUG leads to a memory leak, never use this setting in production environments!


  warn('Using settings.DEBUG leads to a memory leak, never '


[2018-12-18 15:04:38,131: WARNING/MainProcess] celery@TesterCCdeMacBook-Pro.local ready.


[2018-12-18 15:04:39,732: ERROR/MainProcess] Unrecoverable error: AttributeError("'str' object has no attribute 'items'",)


Traceback (most recent call last):


  File "/Development/virtualenv_workspace/py36dj2/lib/python3.6/site-packages/celery/worker/__init__.py", line 206, in start


    self.blueprint.start(self)


  File "/Development/virtualenv_workspace/py36dj2/lib/python3.6/site-packages/celery/bootsteps.py", line 123, in start


    step.start(parent)


  File "/Development/virtualenv_workspace/py36dj2/lib/python3.6/site-packages/celery/bootsteps.py", line 374, in start


    return self.obj.start()


  File "/Development/virtualenv_workspace/py36dj2/lib/python3.6/site-packages/celery/worker/consumer.py", line 280, in start


    blueprint.start(self)


  File "/Development/virtualenv_workspace/py36dj2/lib/python3.6/site-packages/celery/bootsteps.py", line 123, in start


    step.start(parent)


  File "/Development/virtualenv_workspace/py36dj2/lib/python3.6/site-packages/celery/worker/consumer.py", line 884, in start


    c.loop(*c.loop_args())


  File "/Development/virtualenv_workspace/py36dj2/lib/python3.6/site-packages/celery/worker/loops.py", line 76, in asynloop


    next(loop)


  File "/Development/virtualenv_workspace/py36dj2/lib/python3.6/site-packages/kombu/async/hub.py", line 340, in create_loop


    cb(*cbargs)


  File "/Development/virtualenv_workspace/py36dj2/lib/python3.6/site-packages/kombu/transport/redis.py", line 1019, in on_readable


    self._callbacks[queue](message)


  File "/Development/virtualenv_workspace/py36dj2/lib/python3.6/site-packages/kombu/transport/virtual/__init__.py", line 534, in _callback


    self.qos.append(message, message.delivery_tag)


  File "/virtualenv_workspace/py36dj2/lib/python3.6/site-packages/kombu/transport/redis.py", line 146, in append


    pipe.zadd(self.unacked_index_key, delivery_tag, time()) \


  File "/Development/virtualenv_workspace/py36dj2/lib/python3.6/site-packages/redis/client.py", line 2263, in zadd


    for pair in iteritems(mapping):


  File "/Development/virtualenv_workspace/py36dj2/lib/python3.6/site-packages/redis/_compat.py", line 123, in iteritems


    return iter(x.items())


AttributeError: 'str' object has no attribute 'items'


正在回答

3 回答

django 2.1.7 

python 3.6.5

redis 2.10.0


0 回复 有任何疑惑可以回复我~
#1

小鹏友i

请问 您的问题解决了吗 我也遇到了类似的问题 我的是Django==1.11 redis==3.2.1 python 3.5
2019-04-29 回复 有任何疑惑可以回复我~

不行啊,还是报错


0 回复 有任何疑惑可以回复我~

这是因为pip install redis 的版本过高

使用2.10版本即 pip install redis==2.10即可

0 回复 有任何疑惑可以回复我~

举报

0/150
提交
取消

python manage.py celery worker -l INFO必报这个错

我要回答 关注问题
意见反馈 帮助中心 APP下载
官方微信