gpt4 book ai didi

python - 为 Celery 和 Django 启用 Beat 时出现 TypeError

转载 作者:行者123 更新时间:2023-11-28 18:45:59 26 4
gpt4 key购买 nike

我在使用 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',
}
}

有人遇到过吗?或者,也许有人可以解释我如何解决这个错误。

谢谢!

最佳答案

通过以下方式解决此问题:

pip uninstall celery 
pip install celery==3.1.1

关于python - 为 Celery 和 Django 启用 Beat 时出现 TypeError,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20083466/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com