Which versions of python do I need to have on my machine

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?

Paweł Wójcik

Posted 2018-08-06T14:29:43.980

Reputation: 3

Question was closed 2018-08-26T22:28:34.433

You should have those versions that you are using; You should not use python 2 without necessity as it is obsolete and going to be completely retired according to Python core team in 2020, so if it's not requirement - use python 3 – Drako – 2018-08-06T15:00:36.567

Note that at least on Ubuntu, the setup uses Python2 AND Python3 for important portions of the system tools (e.g. apt). Try to remove Python2 OR Python3 and you have a complete mess. – Hannu – 2018-08-06T18:36:57.757

Answers

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.

Austin Hemmelgarn

Posted 2018-08-06T14:29:43.980

Reputation: 4 345