关于python:celery-使用-click报错

39次阅读

共计 1373 个字符,预计需要花费 4 分钟才能阅读完成。

报错内容:

vagrant@vagrant:/vagrant$ celery
Traceback (most recent call last):
  File "/home/vagrant/.local/bin/celery", line 8, in <module>
    sys.exit(main())
  File "/home/vagrant/.local/lib/python3.6/site-packages/celery/__main__.py", line 14, in main
    from celery.bin.celery import main as _main
  File "/home/vagrant/.local/lib/python3.6/site-packages/celery/bin/celery.py", line 14, in <module>
    from celery.app.utils import find_app
  File "/home/vagrant/.local/lib/python3.6/site-packages/celery/app/__init__.py", line 7, in <module>
    from .base import Celery
  File "/home/vagrant/.local/lib/python3.6/site-packages/celery/app/base.py", line 11, in <module>
    from click.exceptions import Exit
ImportError: cannot import name 'Exit'

起因,click 版本不对

谬误的 click

vagrant@vagrant:/vagrant$ pip show click
Name: click
Version: 6.7
Summary: A simple wrapper around optparse for powerful command line utilities.
Home-page: http://github.com/mitsuhiko/click
Author: Armin Ronacher
Author-email: armin.ronacher@active-4.com
License: UNKNOWN
Location: /home/vagrant/.local/lib/python3.6/site-packages
Requires: 
Required-by: click-repl, click-plugins, click-didyoumean, celery

正确的 click

vagrant@vagrant:/vagrant$ pip show click
Name: click
Version: 7.1.2
Summary: Composable command line interface toolkit
Home-page: https://palletsprojects.com/p/click/
Author: 
Author-email: 
License: BSD-3-Clause
Location: /home/vagrant/.local/lib/python3.6/site-packages
Requires: 
Required-by: click-repl, click-plugins, click-didyoumean, celery

正文完
 0