Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a supervisor for python 3? [duplicate]

I want to use supervisor to run celery in production, but I am using python 3 instead of python 2. Is there a supervisor that supports python 3?

Also, is it possible to use python 2 to run supervisor for my python 3 code for celery?

like image 666
PiccolMan Avatar asked Dec 14 '22 12:12

PiccolMan


1 Answers

supervisord is just process manager, fact that itself uses python2 does not mean it can't run python3 application.

Just put your application in virtualenv created with python3.

$ virtualenv -p python3 myvenv

Activate that environment and install your app into it with celery as well. And in supervisor you will use full path to celery from inside that virtualenv.

e.g. I created my python3 virtualenv in /home/beezz/myvenv then celery will be located at /home/beezz/myenv/bin/celery

And here is virtualenv's documentation. In general it's good practice to keep applications in separate virtual environments.

If you are not tied to supervisord somehow, circus is also nice process manager with some cool features and it's python3 ready.

like image 186
beezz Avatar answered Jan 02 '23 03:01

beezz