-
Book Overview & Buying
-
Table Of Contents
Hands-On Software Engineering with Python - Second Edition
By :
Installation of Python varies a bit across operating systems. For macOS and Windows systems, there are installers available for download on the Python website (https://www.python.org/downloads/) that generally take care of everything needed. Those installers include every version of the language going back as far as 2.0.1.
Installation of multiple versions of Python is possible, with caveats
Barring some special considerations for certain Linux distributions, installation of multiple different versions of Python is viable on a single machine. Each installation will typically provide python, python3, python3.xx, and sometimes python3.xx.yy command-line entries that can be used to run it. In cases where there are multiple Python 3.x installations, say 3.11 and 3.12, the most recently installed version will be executed by the python and python3 commands. If a specific version is needed, invoking it with the full python3.xx command will be necessary (e.g., python3.11 or python3.12).
For Linux systems, installation can be more problematic. Many Linux systems have Python installed by default, because some of their programs make use of it. In several cases, those distributions also limit the available versions of Python that can be installed, in order to prevent a user from accidentally breaking system components or programs. Checking the default software installation tools in a Linux distribution is always the best first step: If the specific version of Python that is needed/desired is available, installing it using the standard tools for the distribution is the safest process. The managers of the package repository for the distribution will have made reasonable efforts to prevent installations that can break a system from being available, and anything that is available as an option would be expected to be safe.
In cases where there are no alternative versions available, there are still options worth considering before going down the path of installing from the Python website, or building from source: pyenv and Homebrew.
pyenv (https://github.com/pyenv/pyenv) is a command-line tool that allows a user to install, manage, and switch between different versions of Python at will. While switching between versions has many of the same risks as installing other versions, pyenv's ability to download and install minimal, usable Python versions without interfering with the system-level installations makes it a very good candidate for cases where project- and system-level Python version requirements conflict with each other. pyenv is also recognized by at least one Python project management tool, pipenv, and integrated well enough that the creation of a new project environment with a new Python version is handled by the project manager almost seamlessly.
Homebrew (https://brew.sh/) is a more general-purpose software management tool, capable of installing various Python versions as well as many other software packages. It is not available for Windows, at least as of late 2025, but is a viable option for macOS and Linux systems where multiple Python versions are needed.
If neither of those options is workable, falling back to downloading from the Python website is always possible too. Because of the widely varied package structures across the Linux ecosystem, those downloads are the source code and would require building the local installation from scratch. If this path must be taken, it is important to find a good, step-by-step breakdown of the processes and prerequisites involved. Usually a search along the lines of {your Linux distro name} build python 3.13 from source will yield several options.