celery报错笔记

报错: Invalid value for '-P' / '--pool'

Invalid value for '-P' / '--pool': <class 'celery.concurrency.prefork.TaskPool'> is not one of 'prefork', 'eventlet', 'gevent', 'solo', 'processes', 'threads

此时 执行 celery worker --help 也报错

# celery worker --help
Traceback (most recent call last):
  File "/app/sfimplat_micro/venv/bin/celery", line 11, in <module>
    load_entry_point('celery==5.1.2', 'console_scripts', 'celery')()
  File "/app/sfimplat_micro/venv/lib/python3.6/site-packages/celery-5.1.2-py3.6.egg/celery/__main__.py", line 15, in main
    sys.exit(_main())
  File "/app/sfimplat_micro/venv/lib/python3.6/site-packages/celery-5.1.2-py3.6.egg/celery/bin/celery.py", line 213, in main
    return celery(auto_envvar_prefix="CELERY")
  File "/app/sfimplat_micro/venv/lib/python3.6/site-packages/click-8.0.1-py3.6.egg/click/core.py", line 1137, in __call__
    return self.main(*args, **kwargs)
  File "/app/sfimplat_micro/venv/lib/python3.6/site-packages/click-8.0.1-py3.6.egg/click/core.py", line 1062, in main
    rv = self.invoke(ctx)
  File "/app/sfimplat_micro/venv/lib/python3.6/site-packages/click-8.0.1-py3.6.egg/click/core.py", line 1666, in invoke
    sub_ctx = cmd.make_context(cmd_name, args, parent=ctx)
  File "/app/sfimplat_micro/venv/lib/python3.6/site-packages/click-8.0.1-py3.6.egg/click/core.py", line 923, in make_context
    self.parse_args(ctx, args)
  File "/app/sfimplat_micro/venv/lib/python3.6/site-packages/click-8.0.1-py3.6.egg/click/core.py", line 1379, in parse_args
    value, args = param.handle_parse_result(ctx, opts, args)
  File "/app/sfimplat_micro/venv/lib/python3.6/site-packages/click-8.0.1-py3.6.egg/click/core.py", line 2364, in handle_parse_result
    value = self.process_value(ctx, value)
  File "/app/sfimplat_micro/venv/lib/python3.6/site-packages/click-8.0.1-py3.6.egg/click/core.py", line 2326, in process_value
    value = self.callback(ctx, self, value)
  File "/app/sfimplat_micro/venv/lib/python3.6/site-packages/click-8.0.1-py3.6.egg/click/core.py", line 1279, in show_help
    echo(ctx.get_help(), color=ctx.color)
  File "/app/sfimplat_micro/venv/lib/python3.6/site-packages/click-8.0.1-py3.6.egg/click/core.py", line 704, in get_help
    return self.command.get_help(self)
  File "/app/sfimplat_micro/venv/lib/python3.6/site-packages/click-8.0.1-py3.6.egg/click/core.py", line 1304, in get_help
    self.format_help(ctx, formatter)
  File "/app/sfimplat_micro/venv/lib/python3.6/site-packages/click-8.0.1-py3.6.egg/click/core.py", line 1335, in format_help
    self.format_options(ctx, formatter)
  File "/app/sfimplat_micro/venv/lib/python3.6/site-packages/celery-5.1.2-py3.6.egg/celery/bin/base.py", line 160, in format_options
    rv = param.get_help_record(ctx)
  File "/app/sfimplat_micro/venv/lib/python3.6/site-packages/click-8.0.1-py3.6.egg/click/core.py", line 2727, in get_help_record
    default_value = self.get_default(ctx, call=False)
TypeError: get_default() got an unexpected keyword argument 'call'

解决方案:检查了一下celery需要依赖的模块,安装完成后解决

amqp-5.2.0.tar.gz
billiard-3.6.4.0.tar.gz
cached-property-1.5.2.tar.gz
celery-5.1.2.tar.gz
click-7.1.2.tar.gz
click-didyoumean-0.3.0.tar.gz
click-plugins-1.1.1.tar.gz
click-repl-0.3.0.tar.gz
kombu-5.1.0.tar.gz
prompt_toolkit-3.0.36.tar.gz
redis-3.5.3.tar.gz
redis-py-cluster-2.1.3.tar.gz
vine-5.1.0.tar.gz
wcwidth-0.2.9.tar.gz
posted @ 2024-10-31 15:29  醒日是归时  阅读(5)  评论(0编辑  收藏  举报