Python 2.7 was officially retired on 1 January 2020. The core team no longer fixes bugs or security issues, although distributions may still patch their own packages for a while.
Check what your servers use:
python --version # may be missing, or Python 2.7
python3 --version # Ubuntu 18.04 ships Python 3.6
grep -rl "^#!.*python$" /opt/scripts # scripts still calling plain "python"
What to do:
- Change shebangs to
#!/usr/bin/env python3. - Run
2to3orpython-modernizeon old scripts and read the diff. - Pin dependencies in
requirements.txtand test under Python 3.
CentOS 8 (current release 8.1) no longer installs a default python command at all; you choose with alternatives --set python /usr/bin/python3 or install a module. Ubuntu 18.04 keeps Python 2 available for compatibility, but treat it as legacy.