click-contrib / click-didyoumean

Enable git-like did-you-mean feature in click :sparkles:
MIT License
98 stars 9 forks source link

UsageError #9

Closed cdruet closed 2 years ago

cdruet commented 2 years ago

I run into a resolve_command issue whereas the said command exists. How can I fix this?

(.venv-stoachup) christophe@EP-Macmini Stoachup % celery -A celery_worker worker --loglevel=info --verbose Usage: celery [OPTIONS] COMMAND [ARGS]...

Error: Invalid value for '-A' / '--app': Unable to load celery application. While trying to load the module celery_worker the following error occurred: Traceback (most recent call last): File "/Users/christophe/Apps/Stoachup/.venv-stoachup/lib/python3.8/site-packages/click_didyoumean/init.py", line 34, in resolve_command return super(DYMMixin, self).resolve_command(ctx, args) File "/Users/christophe/Apps/Stoachup/.venv-stoachup/lib/python3.8/site-packages/click/core.py", line 1314, in resolve_command ctx.fail("No such command '{}'.".format(original_cmd_name)) File "/Users/christophe/Apps/Stoachup/.venv-stoachup/lib/python3.8/site-packages/click/core.py", line 550, in fail raise UsageError(message, self) click.exceptions.UsageError: No such command '/Users/christophe/Apps/Stoachup/.venv-stoachup/bin/celery'.

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/Users/christophe/Apps/Stoachup/.venv-stoachup/lib/python3.8/site-packages/celery/bin/celery.py", line 53, in convert return find_app(value) File "/Users/christophe/Apps/Stoachup/.venv-stoachup/lib/python3.8/site-packages/celery/app/utils.py", line 384, in find_app sym = symbol_by_name(app, imp=imp) File "/Users/christophe/Apps/Stoachup/.venv-stoachup/lib/python3.8/site-packages/kombu/utils/imports.py", line 56, in symbol_by_name module = imp(module_name, package=package, **kwargs) File "/Users/christophe/Apps/Stoachup/.venv-stoachup/lib/python3.8/site-packages/celery/utils/imports.py", line 100, in import_from_cwd return imp(module, package=package) File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/importlib/init.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "", line 1014, in _gcd_import File "", line 991, in _find_and_load File "", line 975, in _find_and_load_unlocked File "", line 671, in _load_unlocked File "", line 783, in exec_module File "", line 219, in _call_with_frames_removed File "/Users/christophe/Apps/Stoachup/celery_worker.py", line 37, in celery.start() File "/Users/christophe/Apps/Stoachup/.venv-stoachup/lib/python3.8/site-packages/celery/app/base.py", line 371, in start celery.main(args=argv, standalone_mode=False) File "/Users/christophe/Apps/Stoachup/.venv-stoachup/lib/python3.8/site-packages/click/core.py", line 782, in main rv = self.invoke(ctx) File "/Users/christophe/Apps/Stoachup/.venv-stoachup/lib/python3.8/site-packages/click/core.py", line 1254, in invoke cmd_name, cmd, args = self.resolve_command(ctx, args) File "/Users/christophe/Apps/Stoachup/.venv-stoachup/lib/python3.8/site-packages/click_didyoumean/init.py", line 42, in resolve_command raise click.exceptions.UsageError(error_msg, error.ctx) click.exceptions.UsageError: No such command '/Users/christophe/Apps/Stoachup/.venv-stoachup/bin/celery'.

timofurrer commented 2 years ago

unrelated to click-didyoumean.