How to update Python on Windows?
Last Updated :
13 Aug, 2024
In this article, we are going to see how to update Python in the Windows system. For the sake of example, we will be upgrading from Python 3.6.8 to Python 3.9.6. Here, we will see how to upgrade the Python version.
Upgrading Python on Windows
To check the current version of Python on your system, use the following command in the command prompt:
python -V
This will show you your current Python version as shown below:
Upgrade Python Version Using Executable installer
Follow the below steps to update the Python version on Windows:
Step 1: Visit the Official Site
Go to Python’s official site.
Step 2: Download Python
Click on the Downloads tab.
Here you will get a list of available releases.
Step 3: Download the Python 3.9.6 Installer for Your System
Download the version you need to upgrade to based on your system specifications(ie, 32-bit or 64-bit). Here we will be downloading the 64-bit installer for 3.9.6.
Step 4: Initiate Python 3.9.6 Installation
Click on the installer and it will begin the installation. Make sure to select the “Add Python 3.9 to PATH” option. and click on “Install Now”.
This will start the installation as shown below:
After the installation is successful you will get the following message:
Step 5: Verify Python Installation
Now if you open up your cmd and use the below command:
python -V
You’ll see your version of Python has been updated to 3.9.6 as shown below:
How to update Python on Windows? – FAQs
How Do I Update the Python Version in Windows?
Updating Python on Windows typically involves downloading the latest version of Python from the official Python website and installing it over your current installation. Here’s a step-by-step guide:
- Visit the Official Python Website: Go to python.org and download the latest version of Python for Windows.
- Run the Installer: Launch the downloaded installer. Ensure to check the box that says “Add Python to PATH” at the beginning of the installation process.
- Upgrade Installation: Choose “Upgrade Now” to replace the current version with the new version. This option keeps your scripts, packages, and settings.
- Verify Installation: Open Command Prompt and type
python --version
to check the updated version of Python.
How to Check Latest Version of Python in cmd?
To check the currently installed version of Python using the Command Prompt, you can use the following command:
python --version
If Python is installed and properly added to your system’s PATH, this command will display the version of Python that is currently set as the default.
How Do I Update My Python Package to the Latest Version?
To update a specific Python package to the latest version, use the pip
package manager. Here’s how you can update a package:
pip install --upgrade package_name
Replace package_name
with the name of the package you wish to update.
How Do I Change the Current Version of Python?
If you have multiple versions of Python installed on your Windows machine and you want to change the version used when you run python
commands:
- Adjust the System PATH: Modify the order of paths in your system’s PATH environment variable so that the directory containing the executable of the version you want to use is listed first.
- Use Python Launcher for Windows: The Python Launcher for Windows (
py.exe
) can be used to specify a version when running scripts.
- You can specify the Python version by using:Replace
3.x
with the specific version number, like 3.8
or 3.9
.
py -3.x script.py
How to Update pip in cmd?
To update pip
, the Python package installer, in the Command Prompt, you can run the following command:
python -m pip install --upgrade pip
This command ensures that you are using the latest version of pip
, which is recommended for security and stability reasons and to ensure compatibility with all newly released packages