无法启动celeryd - 错误:冲突的选项字符串: - no-color

时间:2014-05-28 11:30:15

标签: django celery

我使用的是django v1.7.0b4和celery v3.1.1。根据{{​​3}}执行了以下步骤。但是我坚持以下错误。

$ ./manage.py celeryd --help
Starting server in DEVELOPMENT Mode
Traceback (most recent call last):
  File "./manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "/Library/Python/2.7/site-packages/django/core/management/__init__.py", line 427, in     execute_from_command_line
utility.execute()
  File "/Library/Python/2.7/site-packages/django/core/management/__init__.py", line 419, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/Library/Python/2.7/site-packages/django_celery-3.1.10-py2.7.egg/djcelery/management/base.py", line 77, in run_from_argv
return super(CeleryCommand, self).run_from_argv(argv)
  File "/Library/Python/2.7/site-packages/django/core/management/base.py", line 284, in run_from_argv
parser = self.create_parser(argv[0], argv[1])
  File "/Library/Python/2.7/site-packages/django/core/management/base.py", line 265, in create_parser
option_list=self.option_list)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/optparse.py", line 1214, in __init__
add_help=add_help_option)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/optparse.py", line 1256, in _populate_option_list
self.add_options(option_list)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/optparse.py", line 1039, in add_options
self.add_option(option)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/optparse.py", line 1020, in add_option
self._check_conflict(option)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/optparse.py", line 995, in _check_conflict
option)
optparse.OptionConflictError: option -C/--no-color: conflicting option string(s): --no-color

还有其他人面临同样的问题吗?

编辑:

在django v1.6.5中运作良好。

2 个答案:

答案 0 :(得分:1)

您应该使用./manage.py celery worker代替./manage.py celeryd

使用时看起来有错误:

django==1.7b4
celery==3.1.11
django-celery==3.1.10

有助于您避免此问题的一些提示:

  • 当您开始玩项目时,请远离测试版,请使用稳定版本。
  • 请勿使用弃用的方法:./manage.py celeryd./manage celery worker
  • 旧的弃用别名

答案 1 :(得分:1)

django-celery的不相容性在两个月前得到修复:https://github.com/celery/django-celery/pull/320。如果你正在使用virtualenv,那么你可以像这样进行猴子补丁:

sed "s/\(= \['--app', '--loader', '--config'\)\]/\1, '--no-color']/"  -i \
    "$VIRTUAL_ENV/lib/python3.4/site-packages/djcelery/management/base.py"

使用Celery 3.1.13和django-celery 3.1.10测试。