Python is an interpreted, high-level and object-oriented programming language. Developed by Guido van Rossum in 1991, Python is widely used for software and web development, task automation, data analysis , and data visualization . It is a popular language among developers worldwide as it has a straightforward learning curve and is a highly productive language.
As most of the developers have Python installed on their systems, many of them might use the older version. Generally, a new release of Python comes with bug fixes, improved security, and new features. So, it is advisable to use the latest version of Python.
More interestingly, there are two ways to upgrade Python to its latest version. They are using:
- Python Installer
- Chocolatey Package Manager
So, in this article, we shall discuss the step-by-step process of upgrading Python on the Windows system using both the aforementioned methods.
Let us get started!
How to Update Python on Windows OS?
At the time of writing this article, the latest version of Python was Python 3.11.0. So, we will upgrade Python from 3.10.4 to 3.11.0 using both methods.
Let us first understand upgrading Python using the Python installer.
Method 1: Update Python using Python Installer
Follow the below steps to upgrade Python using the Python installer:
Open the command prompt on your system and type the following command. This will let us know the current version of Python installed on the system.
Go to Python’s official website and click on the ‘Downloads’ tab. If you hover over the ‘Downloads’ tab, you will see the latest stable release.
For example, 3.11.0 right now is the latest stable release.
After clicking on the ‘Downloads’ tab, you’ll see a yellow button to download the latest Python executable file. Today, it is 3.11.0.
Click on that button and wait for the download to complete. An executable file will be downloaded in the download section of your system.
If you don’t want the latest stable release, you can choose from the list of release installers available on their website.
Click on the executable file to start upgrading Python in the system. Click on “Install Now” in the installation wizard and wait for the installation to complete. Don’t forget to check the ‘Add python.exe to PATH’ checkbox. Otherwise, you have to do it manually after upgrading.
Wait for the installation to complete, and do not restart your system during the installation.
After installation is completed, you will get this message “Setup was successful”. You can close this wizard now.
Open the command prompt again, and enter the same command you have used in Step 1. If Python is upgraded, it will tell us the latest version; otherwise, it will tell us the previous version only.
Method 2: Update Python using Chocolatey Package Manager
Follow the below steps to upgrade Python using the Chocolatey installer.
Verify if Chocolatey is installed on the system.
If it is installed, you can skip this step. Otherwise, use the below command to install.
Open the Command Prompt and enter the following command.
Set-ExecutionPolicyBypass -ScopeProcess -Force; ` iex ((New-ObjectSystem.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
Close and reopen the PowerShell prompt and confirm the installation.
Use the following command to verify if Chocolatey is successfully installed on your system.
Now, you are ready to update Python using Chocolatey.
Use the following command to update and use the latest version of Python.
choco upgrade python -y
When you update to the latest version of Python, you can take advantage of the new features, bug fixes, and improved security. Either you choose the Python installer or Chocolatey package manager, we have provided a step-by-step guide for both methods. Follow these simple steps and update to the latest version of Python.
People are also reading:
- Install Python 3 on Windows 10
- How to Install Django on Windows?
- How to Install Jupyter Notebook?
- Install Python 3 on Ubuntu 18.04 or 20.04
- How to Update all Python Packages?
- Install Python package using Jupyter Notebook
- How to Install Docker on Windows 11?
- Install PIP on Windows, macOS, and Linux
- How to Install Kali Linux?
- How To Install TensorFlow?