The support for this usage was removed in Celery 5.0. Instead you should use `-A` as a global option: celery -A celeryapp worker <...>

Viewed 4770

./celery.sh 2 ⨯ You are using -A as an option of the worker sub-command: celery worker -A celeryapp <...>

The support for this usage was removed in Celery 5.0. Instead you should use -A as a global option:
celery -A celeryapp worker <...>
Usage: celery worker [OPTIONS] Try 'celery worker --help' for help.

Error: no such option: -A

2 Answers

As mentioned in the release notes (breaking changes) documentation:

The global options can no longer be positioned after the sub-command. Instead, they must be positioned as an option for the celery command

That means that you need to change from:

celery worker -A celeryapp <...>

to

celery -A celeryapp worker <...>

Is your first argument to Celery being the same as your file name?

app = Celery('tasks', broker='redis://localhost:6379/0')

I changed [tasks] same as my filename and run the command again, then it works.

celery -A myfilename worker
Related