在窗户上运行django-celery。引发EOFError

时间:2013-03-10 01:18:42

标签: django windows python-2.7 pickle django-celery

我正在使用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但它没有帮助

由于

1 个答案:

答案 0 :(得分: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 {})

它应该可以正常工作