运行python manage.py celery worker -l INFO时报错:

Traceback (most recent call last):

  File “D:sofapythonlibsite-packagesceleryworker__init__.py”, line 206, in start

    self.blueprint.start(self)

  File “D:sofapythonlibsite-packagescelerybootsteps.py”, line 123, in start

    step.start(parent)

  File “D:sofapythonlibsite-packagescelerybootsteps.py”, line 374, in start

    return self.obj.start()

  File “D:sofapythonlibsite-packagesceleryworkerconsumer.py”, line 280, in start

    blueprint.start(self)

  File “D:sofapythonlibsite-packagescelerybootsteps.py”, line 123, in start

    step.start(parent)

  File “D:sofapythonlibsite-packagesceleryworkerconsumer.py”, line 884, in start

    c.loop(*c.loop_args())

  File “D:sofapythonlibsite-packagesceleryworkerloops.py”, line 103, in synloop

    connection.drain_events(timeout=2.0)

  File “D:sofapythonlibsite-packageskombuconnection.py”, line 288, in drain_events

    return self.transport.drain_events(self.connection, **kwargs)

  File “D:sofapythonlibsite-packageskombutransportvirtual__init__.py”, line 847, in drain_events

    self._callbacks[queue](message)

  File “D:sofapythonlibsite-packageskombutransportvirtual__init__.py”, line 534, in _callback

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

  File “D:sofapythonlibsite-packageskombutransportredis.py”, line 146, in append

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

  File “D:sofapythonlibsite-packagesredisclient.py”, line 2388, in zadd

    for pair in iteritems(mapping):

  File “D:sofapythonlibsite-packagesredis_compat.py”, line 110, in iteritems

    return iter(x.items())

AttributeError: ‘str’ object has no attribute ‘items’

查询资料发现是redis版本过高(3.2.100),重装redis

pip install redis==2.10.6

参考链接

文章来源于互联网,如有雷同请联系站长删除:Django-celery运行报错

发表评论