Current release 47.1.1 breaks supervisor 3.2.0: UserWarning: Setuptools no longer works on Python 2
See original GitHub issuePrerequisites
- Python 2 is not required for this application.
- I maintain the software that installs Setuptools (if not, please contact that project).
- Setuptools installed with pip 9 or later.
- Pinning Setuptools to
setuptools<45
in the environment was unsuccessful.
Environment Details
- Operating System and version: Ubuntu 16.04.5 LTS
- Python version: Python 3.5.2
- Python installed how: apt-get
- Virtualenv version (if using virtualenv): n/a
Command(s) that triggered the warning/error (and output):
root@a84144be0db1:/# python --version
Python 3.5.2
root@a84144be0db1:/# supervisord
/app/python/pkg_resources/py2_warn.py:15: UserWarning: Setuptools no longer works on Python 2
************************************************************
Encountered a version of Setuptools that no longer supports
this version of Python. Please head to
https://bit.ly/setuptools-py2-sunset for support.
************************************************************
warnings.warn(pre + "*" * 60 + msg + "*" * 60)
Command(s) used to install setuptools (and output):
We use apscheduler
which in turn installs the latest setuptools
version.
Collecting setuptools>=0.7 (from apscheduler==3.5.3->sensei_sdk==3.0.2)
Downloading https://artifactory.corp.adobe.com/artifactory/api/pypi/pypi-sensei-framework-release/packages/packages/95/95/f657b6e17f00c3f35b5f68b10e46c3a43af353d8856bd57bfcfb1dbb3e92/setuptools-47.1.1-py3-none-any.whl (583kB)
Output of pip --version
when installing setuptools:
pip 19.0.3 from /usr/local/lib/python3.5/dist-packages/pip (python 3.5)
Other notes
This potentially breaks other tools.
Issue Analytics
- State:
- Created 3 years ago
- Comments:12 (7 by maintainers)
Top Results From Across the Web
The 'supervisor==3.2.0' distribution was not found and is ...
Go to /usr/bin/supervisorctl file. Update the first line to !/usr/bin/python2. to make the supervisor use the python 2.7 installed ...
Read more >supervisor - PyPI
Supervisor is a client/server system that allows its users to control a number of processes on UNIX-like operating systems.
Read more >Install with gunicorn3 not gunicorn - Google Groups
FYI, there's a really nasty problem if you install netbox under ubuntu 16.04 with python 3, and then follow the instructions at ...
Read more >Can't start after update to 2.8 - CryoSPARC Discuss
Hi I just updated to Version 2.8 however I can't start cryosparc anymore. I am getting: Starting cryoSPARC System master process…
Read more >Installing — Supervisor 4.2.4 documentation - Supervisord
Since both pip and python setup.py install depend on internet access to perform downloads of dependent software, neither will work on machines without...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Aha. Yes!
So if I understand correctly, supervisord 3 only runs on Python 2, so even though you’re installing it with apt-get, you’re getting a version that relies on Python 2.
When you install apscheduler, you’re installing that on Python 3.
So far, so good. These systems can interoperate in separate processes (i.e. through
subprocess()
or through RPC/HTTP calls). The problem becomes if you try to bind them at the library level…And that’s exactly what will happen if you set
PYTHONPATH
.PYTHONPATH
is honored by all python processes, on Python 2 or 3… and will try to use libraries from one Python environment in another. A simpler example:In this example, I’ve created a
py3libs
directory and installedsetuptools
to it. I’ve then added that target, which could contain any number of libraries that only run on Python 3, to PYTHONPATH and run Python 2. That’s where I’ve basically said, “Python 2, please run with these Python 3 libraries.” Obviously, not a great idea, and no surprise it fails. Here’s an example with another package:It’s just not going to work to have a Python 2 environment pointing at a directory with Python 3 libs, and this doesn’t have anything to do with Setuptools specifically.
Probably your easiest workaround here is when you’re installing
apscheduler
, just also installsetuptools<45
. It’s still Python 3 compatible and is probably suitable for anything you’re doing.That should buy you the time until you can migrate to supervisord 4 and bid Python 2 a well-deserved farewell.
Another option might be to unset PYTHONPATH when invoking anything around
supervisord
. That will avoid injecting the libraries into the supervisord environment.Do either of those techniques help?
Again, I am just a concerning user and a seldom contributor happening to hang around this issue tracker and IMHO if a Python 3 program uses Python 2 setuptools that’d be the program’s bug. Based on your previous investigation, for example supervisor fixed that such bug somewhere between version 3.2.0 and 4.2.0.
Indeed version 47 is a breaking change for Python 2 but there’s been version 45 and 46 for the deprecation period. I don’t speak for setuptools but I don’t think it’s its job to support something that’s already declared sunset nor questionable/buggy behaviors. In case Python 2 compatibility is desired, one can always pin to setuptools<45 which AFAIK still receive urgent bug fixes.