supervisord for python 3?

Question:

Want to use supervisord to control the processes for my Python 3 project. It is specifically stated that “Supervisor is known to work with Python 2.4 or later but will not work under any version of Python 3”.

Any suggestions for supervisor replacement for Python 3?

Asked By: user2777473

||

Answers:

The upcoming 4.0 release of Supervisord will support Python 2.7, and 3.4 and up. Until then, you could use the supervisor-py3k fork.

Or simply run supervisord with Python 2; your Python 3 codebase is otherwise unaffected, as supervisord is an independent process.

Answered By: Martijn Pieters

Master branch of Supervisor already supports Python3. It’s a development version, so please notify any bug you find.

Answered By: Adrian Lopez

Python 3 support for supervisord is still experimental and as mentioned in documentation, you shouldn’t use it in production.

Mozilla Foundation has developed a package called circus which works on Python 3.

It manages process with circusd and it also has circusctl, circus-top, circus-web(similar to supervisor).

You can use your supervisor conf file with circus with some changes. It also has a seperate section in docs for users coming from supervisor. You can read that for more details.

Update:
Latest master has python 3 support. You can install it with

pip install git+https://github.com/Supervisor/supervisor
Answered By: Chillar Anand

To use supervisord with Python 3 you can setup it directly with pip:

pip install git+https://github.com/Supervisor/supervisor
Answered By: Vasili Pascal

supervisor 4+ supports Python3, It’s available in PyPI so you can simply do pip install supervisor to install it.

Answered By: atb00ker

For anyone that finds this thread, here is what I’ve found…

The system installed version of supervisor, installed via apt, presently is 3.3.1. This is ubuntu 18.04.

What is important to note is that the first line in /usr/bin/supervisord is #!/usr/bin/python.

This is the python 2.7 version on my system.

Looking at https://github.com/Supervisor/supervisor/blob/3.3.1/supervisor/supervisord.py, it has #!/usr/bin/env python as the first line. This could possibly call a python3 version if it is set in the path whereby python implies python3.

However…

It appears that the install produces a stub program in /usr/bin/supervisord which then calls an entry point, thereby running the supervisord.py code.

So no matter how you set your path, how python may be set to calling a python3 program…

Its not going to get around the hard-coded #!/usr/bin/python call in /usr/bin/supervisord.

One alternative is setting up alternatives which results in /usr/bin/python being python3.

So you need to do some tracking down of how python2 and python3 are deployed on your system.

Answered By: Otto Hirr
Categories: questions Tags: , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.