问答详情
源自:4-1 Django 中配置使用 Celery

python manage.py celery worker -l INFO必报这个错

  File "/Users/podao/venv/celery_imooc/lib/python2.7/site-packages/django/core/management/__init__.py", line 40, in load_command_class

    module = import_module('%s.management.commands.%s' % (app_name, name))

  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/importlib/__init__.py", line 37, in import_module

    __import__(name)

  File "/Users/podao/venv/celery_imooc/lib/python2.7/site-packages/djcelery/management/commands/celery.py", line 11, in <module>

    class Command(CeleryCommand):

  File "/Users/podao/venv/celery_imooc/lib/python2.7/site-packages/djcelery/management/commands/celery.py", line 23, in Command

    preload_options)

TypeError: can only concatenate list (not "tuple") to list


提问者:小马_125 2019-06-29 18:18

个回答

  • 小马_125
    2019-06-29 18:28:40

    都可以试试这个解决方法:
    找到python安装库的位置,找到该文件 \lib\site-packages\djcelery\management\commands\celery.py。在文件中注释掉如下代码:

    # options = (cc_options +
    #            base_options +
    #            preload_options)