Python is a popular, cross-platform programming language that developers used to create applications, write automation scripts, configure servers, and much more. It enables them to do more with less code (as compared to some other programming languages) and has a syntax similar to the English language.
Like all other software, the Python language also receives updates, incrementing its version number. Today, we are going to show you how you can identify which Python version is installed on your PC so you know whether you are using the latest version or an older one.
Table of contents
- Python Version Nomenclature
- How to Install Python
- How to Check Installed Python Version
- See List of Installed Python Versions
- Closing Words
Python Version Nomenclature
The Python programming language’s version is in 3 parts. It is 3 numbers divided by 2 decimal points, like this:
The “X” is the major version, “Y” is the minor version, and “Z” is the micro version.
Usually, the major releases are not compatible with one another. For example, Python version 3.11.0 would not be compatible with 2.7.3. However, the minor releases are generally compatible with each other. For example, 3.11.0 would be compatible with 3.9.2.
The micro versions are mostly patches and updates.
Now let us continue to see how to install Python on your PC.
How to Install Python
Install Python on Windows
Unlike Linux, installing Python on a Windows computer is easier since it comes in an executable .EXE bundle, and you do not need to use the terminal for it.
Follow these steps to install Python on your Windows PC:
Open the Python downloads page using any web browser and click Download Python X.Y.Z. This will download the latest available version of Python.
Alternatively, you can also download Python from Microsoft Store.
Once downloaded, run the package to install Python.
You will now see the installation wizard. Click Install Now.
Python installation will now begin. When the process completes, click Close.
You have successfully installed the Python programming language on your computer.
If you wish to uninstall it in the future, here are the steps:
Open the Programs and Features applet by typing in appwiz.cpl in the Run Command box.
Right-click on “Python” followed by the version number and then click Uninstall from the context menu.
You will then see the uninstallation wizard running and removing Python from your PC. When it is completed, Python will have been removed. Close the wizard.
Install Python on macOS
Installing Python on Mac is very much similar to Windows since it also comes in an executable .PKG file. But before you do, check if it is already installed since most macOS devices have it preinstalled.
If it is not available, follow these steps to install it:
Open the Python downloads page for macOS using any web browser and click Latest Python X Release – Python X.Y.Z. This will download the latest available version of Python.
When downloaded, run the package to begin the installation and follow through with the on-screen instructions.
When installed, close the wizard, and Python would have been installed successfully.
Install Python on Linux
Like macOS, most Linux distros also have Python preinstalled. However, if you don’t, follow these steps to install it:
In the terminal, run the following cmdlet:
sudo apt-get install python3.11
This will now install the specified version of Python. To upgrade to the latest available run, run the following cmdlets one after the other:
sudo apt-get update sudo apt-get upgrade
You will now have installed the latest version of Python on your Linux machine.
How to Check Installed Python Version
Check Python Version on Windows
There are different ways you can check the version number of Python installed on a Windows PC.
The simplest way to determine the Python version installed on your computer is from the Start menu.
Simply search for “Python” in the Start menu and the application will pop up along with the version number, as in this picture:
However, this method does not show the micro version number, therefore may not be ideal for many.
From the Python App
Another method to find the Python version is through the Python terminal itself. All you need to do is open the app and the terminal will display the complete version.
Open the Python terminal either by searching for it in the search box in the taskbar, through the Start menu, or by typing in python in the Run Command box.
You will then see the full version of Python at the top of the terminal.
From Windows PowerShell
You can also check the installed Python version through Windows PowerShell. Simply run the following cmdlet in an elevated PowerShell instance:
You shall now see the version of Python installed on your PC.
When running the cmdlet given above, the chances are that you may run into an error stating the following:
Python was not found; run without arguments to install from Microsoft Store or disable this shortcut from Settings > Manage App Execution Aliases
This error occurs because Python does not automatically add itself to the environmental variables. However, you can add them yourself using these steps:
Navigate to the following directory using File Explorer:
Replace [Username] with the user account name you are using, and [XYZ] is Python’s version number which will vary according to the version that you have installed.
Moreover, the AppData directory is hidden, so you will either need to view hidden directories or enter the path for it manually in the navigation bar.
This path will be needed in the steps ahead. We navigate to this path using Explorer since it includes some variables, and we will need the exact path.
Now, we must add the environmental variables. To do that, open the System Properties applet by typing in sysdm.cpl in the Run Command box.
Switch to the Advanced tab and then click Environmental Variables.
From the Environmental Variables window, click Path under the System Variables section and then click Edit.
From the Edit window, click New, and then enter the following path from File Explorer:
Now click New again, and now enter the following variable:
Now click Ok on all the open windows to save the settings and close the windows.
After performing these steps, you should now be able to check the Python version from Windows PowerShell.
Check Python Version on macOS/Linux
Checking the installed Python version on macOS or a Linux machine is very much similar to Windows. All you need to do is run the following cmdlet in the terminal:
You should now get the complete version number for Python.
See List of Installed Python Versions
Users can install more than one Python version on their computers, provided the major build is different. In this case, you can obtain a list of the versions that are installed on your computer.
Just run the following cmdlet to see the version numbers of all Pythons installed on your computer in an elevated PowerShell instance:
Python developers can know which version is running on their computers using the given guide above. However, this information is only useful if you are looking for a specific version, having a specific feature or function. You can view the changelog history of all Python 3 versions from here and Python 2 versions from here.