1

我正在使用 Windows 7 64 位。我安装了最新版本的台球、django-celery 和 kombu。包括我:

import djcelery
djcelery.setup_loader()

到我的项目setting.py

当我从项目的根目录运行以下命令时:

python manage.py celeryd -l info

我收到以下消息(这是消息的最后一部分):

File "c:\python27\lib\pickle.py", line 562, in save_tuple
    save(element)
  File "c:\python27\lib\pickle.py", line 286, in save
    f(self, obj) # Call unbound method with explicit self
  File "c:\python27\lib\pickle.py", line 548, in save_tuple
    save(element)
  File "c:\python27\lib\pickle.py", line 306, in save
    rv = reduce(self.proto)
  File "c:\python27\lib\site-packages\celery\app\base.py", line 412, in __reduce__
    (self.__class__, self.Pickler) + self.__reduce_args__(),
  File "c:\python27\lib\site-packages\celery\app\base.py", line 422, in __reduce_args__
    else self.conf._pickleable_changes())
  File "c:\python27\lib\site-packages\celery\app\utils.py", line 77, in _pickleable_changes
    R.update(d)
TypeError: 'LazySettings' object is not iterable

C:\sources\tourtle>Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "c:\python27\lib\site-packages\billiard\forking.py", line 530, in main
    self = load(from_parent)
  File "c:\python27\lib\pickle.py", line 1378, in load
    return Unpickler(file).load()
  File "c:\python27\lib\pickle.py", line 858, in load
    dispatch[key](self)
  File "c:\python27\lib\pickle.py", line 880, in load_eof
    raise EOFError
EOFError

我安装了 MinGW 并将 distutils.cfg 添加到 c:\MinGW\bin 但它没有帮助

谢谢

4

1 回答 1

1

在 github 上查看这个讨论:

https://github.com/celery/django-celery/issues/228

一种解决方法是您按照 asksol 建议的方式更改 celery/app/base.py(第 418-419 行):

从:

conf = (self.conf.changes if _forking._forking_is_enabled
        else self.conf._pickleable_changes())'

至:

conf = (self.conf.changes if _forking._forking_is_enabled
        else {})

然后它应该可以正常工作

于 2013-03-11T07:50:54.927 回答