Failure to start celeryd - Error : conflicting option string(s): --no-color

匿名 (未验证) 提交于 2019-12-03 00:56:02

问题:

I'm using django v1.7.0b4 and celery v3.1.1. Followed steps according to the django installation guide. But I'm stuck with the below error.

$ ./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

Is any one else facing the same issue ?

Edited :

Working good in django v1.6.5.

回答1:

You should use ./manage.py celery worker instead of ./manage.py celeryd

Looks like there is an bug when you use:

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

Few tips which will help you avoid this issues:

  • When you are starting playing with a project stay away from beta releases, use stable release.
  • Don't use deprecated methods: ./manage.py celeryd is old deprecated alias for ./manage celery worker


回答2:

The incompatibility in django-celery was fixed two months ago: https://github.com/celery/django-celery/pull/320. If you are using virtualenv, then you could monkey-patch like this:

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

Tested with Celery 3.1.13 and django-celery 3.1.10.



易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!