Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

210
Vistas
ImportError: cannot import name 'Command' from 'celery.bin.base'

When I run the command

flower -A main --port=5555

Flower doesn't work, the error is:

> ImportError: cannot import name 'Command' from 'celery.bin.base'

Any ideas? Main is a Django Project

over 4 years ago · Hanz Gallego
5 Respuestas
Responde la pregunta

0

Flower is always lagging behind Celery, so if you use the latest Celery (they refactored the CLI) it will probably fail. Stick to 4.4.x until Flower catches up.

over 4 years ago · Hanz Gallego Denunciar

0

One workaround, if you prefer to avoid downgrading your Celery worker, is to run a previous version of Flower separate from your main Celery install. For example, in a container or separate venv. Flower just monitors your broker, and can be run completely separate from your Celery worker.

Flower in Docker example

For your Django/Celery install, run Celery normally (no Flower):

celery -A main worker

For Flower, use docker image mher/flower:0.9.5, which internally uses Celery 4.4.6, and is reported working.

Here is a sample docker run command:

docker run --name flower -p 5555:5555 mher/flower:0.9.5 flower --broker=redis://redis-address

Note: You must change the broker address to be your broker's dns-resolvable name or ip. For rabbitmq, use --broker=amqp://guest@rabbitmq-address:5672//. See the url documentation for advanced options.

Once running, Flower should be available at the Docker host's IP:5555

You can alternatively create a docker-compose file encapsulating all of the arguments in the run command, and use docker-compose up -d.

Alternatives

If preferred, you can also do all this without Docker, using pip install flower redis celery==4.4.7, as long as it is separate from your main Celery install, and then run flower with flower --broker=redis://redis-address. A separate venv may work for this.

See the github issue for future updates on the original bug.

over 4 years ago · Hanz Gallego Denunciar

0

Had same issue while working on celery 5.0.5 so switched to celery 4.4.7 version with flower 0.9.7 and it worked.

over 4 years ago · Hanz Gallego Denunciar

0

You may downgrade Celery as many people have already suggested, or, as in my case, upgrade flower to the last version, which is now 1.0.0 since july 2021 -> https://pypi.org/project/flower/.

I can confirm this last version is compatible with celery[auth,redis,tblib]==5.1.2.

Personally I'd suggest that you tried to upgrade packages instead of downgrading them, and that upgrading flower has less chances of breaking your project than downgrading celery.

over 4 years ago · Hanz Gallego Denunciar

0

Maybe you can try pip install https://github.com/mher/flower/zipball/master#egg=flower

over 4 years ago · Hanz Gallego Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda