How to run celery worker on Windows without creating Windows Service? Is there any analogy to $ celery -A your_application worker
?
相关问题
- how to define constructor for Python's new Nam
- streaming md5sum of contents of a large remote tar
- How to get the background from multiple images by
- Evil ctypes hack in python
- Correctly parse PDF paragraphs with Python
There are two workarounds to make Celery 4 work on Windows:
See https://www.distributedpython.com/2018/08/21/celery-4-windows for more details
It's done the same way as in Linux. Changing directory to module containing celery task and calling
"c:\python\python" -m celery -A module.celery worker
worked well.yes:
also note Celery have dropped support for Windows(since v4), so best to
3.1.25 was the last version that works on windows(just tested on my win10 machine). Didn't need to downgrade flower(browser monitor for celery) though.
See also the FAQ for Windows
Celery 4.0+
does not officially support window already. But it still works on window for some development/test purpose.Use
eventlet
instead as below:It works for me on
window 10
+celery 4.1
+python 3
.This solution solved the following exception:
===== update 2018-11 =====
Eventlet has an issue on subprocess.CalledProcessError:
https://github.com/celery/celery/issues/4063
https://github.com/eventlet/eventlet/issues/357
https://github.com/eventlet/eventlet/issues/413
So try
gevent
instead.This works for me on
window 10
+celery 4.2
+python 3.6
I have run celery task using RabbitMQ server. RabbitMq is better and simple than redis broker
while running celery use this command "celery -A project-name worker --pool=solo -l info" and avoid this command "celery -A project-name worker --loglevel info"
I've made a .bat file besides my manage.py file with this code:
so each time I want to run celery, I just double-click this batch file and it runs perfectly. And the fact that you can't use celery 4 on windows is true.