Installing Python

Featured image

This article explains how to install Python on Windows.

📖 Contents ⬇️

Contents

Downloading

Go to https://www.python.org/ and download the Windows version:

Choosing the latest Python version for Windows

Figure 1: Choosing the latest Python version for Windows

But usually several months or a year pass after a new Python version is released before well-known and needed libraries adapt to it. So it makes sense to install the previous Python version. For example, in the screenshot above the latest version is 12 (yours may already be different). So it is worth choosing Python 11. To do this, on the page https://www.python.org/downloads/windows/ find the latest such Python release that has the line Download Windows installer (64-bit) and download that file:

Choosing the previous Python version for Windows

Figure 2: Choosing the previous Python version for Windows


Installation

On the first step, be sure to check the Add Python to PATH option:

Choosing the default installation

Figure 3: Choosing the default installation

Choosing the default installation

Figure 4: Choosing the default installation

There may also be an option to remove the Windows path length limit:

Removing the path length limit

Figure 5: Removing the path length limit

End of installation

Figure 6: End of installation

Checking Python

This part is optional, but it is a good idea to check how you installed Python.

Launch the cmd command prompt or any other terminal (for example, Windows Terminal). There are many ways to do this. For example, through search:

Launching the command prompt in Windows 10

Figure 7: Launching the command prompt in Windows 10

Launching the command prompt in Windows 11

Figure 8: Launching the command prompt in Windows 11

Enter the python command and press Enter to start the Python interpreter:

Launching the Python interpreter

Figure 9: Launching the Python interpreter

Enter some code, for example 1+1, and press Enter. If 2 is printed, everything is fine and Python was installed correctly:

Example of an arithmetic operation

Figure 10: Example of an arithmetic operation

After that, you can close the command prompt.

By the way, if you want to exit the Python interpreter to continue working in the command prompt, press Ctrl + Z, then Enter.

Sometimes you may have problems because of an outdated pip, which you can update in the console with:

python -m pip install --upgrade pip