为Belery和Django启用Beat时的TypeError

时间:2013-11-19 22:29:22

标签: python django celery

我在使用python manage.py celeryd -B -E

开始使用芹菜时遇到问题

我在Debian Wheezy的virtualenv中运行python 3.2.3。

这些是我的virtualenv中运行的版本:

Django==1.6
Pillow==2.2.1
South==0.8.3
amqp==1.3.3
anyjson==0.3.3
billiard==3.3.0.7
celery==3.1.4
django-celery==3.1.1
docutils==0.11
kombu==3.0.5
psycopg2==2.5.1
pytz==2013.8
wsgiref==0.1.2

这是我尝试此命令python manage.py celeryd -B -E

时收到的错误
[2013-11-19 16:57:32,443: ERROR/MainProcess] Process Beat

Traceback (most recent call last):
  File "/home/webuser/.virtualenvs/web/lib/python3.2/site-packages/billiard/process.py", line 282, in _bootstrap
    self.run()
  File "/home/webuser/.virtualenvs/web/lib/python3.2/site-packages/celery/beat.py", line 507, in run
    ] + list(iter_open_logger_fds()))
  File "/home/webuser/.virtualenvs/web/lib/python3.2/site-packages/celery/platforms.py", line 248, in close_open_fds

    for f in uniq(sorted(keep or []))
TypeError: unorderable types: _io.TextIOWrapper() < _io.TextIOWrapper()

没有节拍跑步让我没有错误。

这是我的settings.py

的摘录
INSTALLED_APPS = (
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    'south',
    'djcelery',
)

# Celery Application Settings

BROKER_URL = "amqp://placeholder:placeholder@localhost:5672/placeholder"
CELERY_RESULT_BACKEND = "database"

CELERY_RESULT_DBURI = "postgresql://placeholder:placeholder@localhost/placeholder"

import djcelery
djcelery.setup_loader()


MIDDLEWARE_CLASSES = (
    'django.contrib.sessions.middleware.SessionMiddleware',
    'django.middleware.common.CommonMiddleware',
    'django.middleware.csrf.CsrfViewMiddleware',
    'django.contrib.auth.middleware.AuthenticationMiddleware',
    'django.contrib.messages.middleware.MessageMiddleware',
    'django.middleware.clickjacking.XFrameOptionsMiddleware',
)

ROOT_URLCONF = 'web.urls'

WSGI_APPLICATION = 'web.wsgi.application'


# Database
# https://docs.djangoproject.com/en/1.6/ref/settings/#databases

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.postgresql_psycopg2',
        'NAME': 'placeholder',
        'USER': 'placeholder',
        'PASSWORD':     'placeholder',
        'HOST': 'localhost',
    }
}

有没有人经历过这个?或者也许有人可以解释我如何解决这个错误。

谢谢!

1 个答案:

答案 0 :(得分:1)

通过以下方式解决这个问题:

pip uninstall celery 
pip install celery==3.1.1
相关问题