0

It is known that on Linux I should have python2.x, however to take advantage of the newest features of the language I want to also have and use a new version of python. That makes already two versions of python present on my machine. Are there any 'intermediate' versions of python necessary for my system to run well?

Apparently there are situations where more that one old python version is present on a system. Which of the 'old' versions are the most recommended ones to have on a machine?

1 Answers1

1

First off, you shouldn't just blindly have Python 2 on Linux. A lot of distributions these days don't need it and only install it for compatibility reasons. If the OS came pre-installed with it, keep it, but otherwise, don't go out of your way to install it unless you have some software that actually needs it. Some Linux systems don't even have it by default anymore (Arch for example).

Beyond that, as suggested in the comments, only install what versions you actually need. In other words, if you have no software using Python version X.Y, and the OS didn't automatically install it, don't have it installed on your system. This advice applies in general to almost any programming language though. More code translates to more possibilities for an attacker to exploit a bug.

Building on this advice with a real-world example:

On my Gentoo systems, I currently have Python 2.7, 3.6, and 3.7.

  • I need Python 2.7 because I have a few packages that require AsciiDoc for their documentation, and that only works with Python 2.7.
  • I need Python 3.6 because that's the primary version supported by almost all other code on my system (and in fact, by most of the Python related packages in Gentoo right now).
  • I need Python 3.7 for new development work and testing purposes.

I could in theory also have Python 3.4 and 3.5 installed on these systems, but I don't because I have exactly zero software that needs either of them.