Table of contents
1.
Introduction
2.
Why is it Important?
3.
Upgrading Python in Windows
4.
Upgrading Python in Linux
5.
Upgrading Python on MacOS
6.
Frequently Asked Questions
6.1.
Can I have multiple Python versions installed on my system?
6.2.
Is uninstallation of previous versions of Python needed before upgrading?
6.3.
How do I check my current Python version?
6.4.
Can I downgrade my Python version if I encounter compatibility issues?
6.5.
How often should I upgrade my Python version?
6.6.
How do I change the version of Python in CMD?
7.
Conclusion
Last Updated: Mar 27, 2025
Easy

Upgrade Python Version

Career growth poll
Do you think IIT Guwahati certified course can help you in your career?

Introduction

Hello Ninjas, Python is a popular programming language in various domains, including web development, scientific computing, data analysis, and artificial intelligence. The language constantly evolves, and new versions are released regularly, bringing new features, bug fixes, and security enhancements. We must update our Python installation to take advantage of these improvements and ensure compatibility with the latest libraries and frameworks.

upgrade python version

In this article, we will discuss step-by-step procedures along with screenshots for each operating system. For more information on Python, visit this blog.

Why is it Important?

  • Secure Data Transfer – SFTP encrypts both commands and data, preventing unauthorized access and protecting sensitive information.
     
  • Authentication & Access Control – It supports SSH-based authentication, ensuring that only authorized users can access the server.
     
  • Data Integrity Verification – Unlike FTP, SFTP provides checksum verification to ensure files are not altered during transmission.
     
  • Firewall-Friendly – SFTP operates on a single port (port 22), making it easier to configure and secure behind firewalls.
     
  • Compliance with Security Standards – Many organizations prefer SFTP for compliance with data protection regulations such as GDPR, HIPAA, and PCI-DSS.
     
  • Protection Against Cyber Threats – Since FTP transmits data in plain text, it is vulnerable to attacks like packet sniffing and man-in-the-middle attacks. SFTP mitigates these risks by encrypting all transmissions.

Upgrading Python in Windows

The Python in windows can be upgraded using an installer file. Follow the steps below:

1. Open the cmd and write the below command to check the current version of Python:

python --version

 

2. Download the installer from this site for Windows:

download page

 

3.  Run the installer. Both boxes must be checked, then click on install now:

installer


4. After completing the installation. Run the below command to check the updated version:

python --version


Output:

final version

Upgrading Python in Linux

This can be upgraded easily using the Linux terminal. Follow the steps below:

1. Open the terminal using the command Ctrl+Alt+T. Check the current version of the installed Python (It comes preinstalled in Linux) using this command:

python3 --version

 

Output:

initial version


2. Add this deadsnake repository to your system containing the Python files. Use this command:

sudo add-apt-repository ppa:deadsnakes/ppa


Output:

adding deadsnake repo

Now update the repository using this command:

sudo apt update

 

3. To check the latest version of Python, go to this page. Check if the latest version of Python is available in the repository using this command:

apt list | grep python3.10

 

Output:

checking availability


4. If the system gives the above output, then install the latest version using this command:

sudo apt install python3.10


Output:

installing python


5. The above-installed version is not the default. First, set the current default path. Follow the below steps to do so:

sudo nano /usr/bin/gnome-terminal


In the first line, change #!/usr/bin/python3 to #!/usr/bin/python3.8. Press Ctrl +X and then Enter to save and exit.
 

6. Now add the path for the latest installed version: 

sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.10 2

 

7. Change the default version to the latest, following the below command. Select the latest version using the given index:

sudo update-alternatives --config python3


Output:

setting alternate path


8. The default version has been updated to the latest. To recheck the version, run the below command:

python3 --version


Output:

latest version

Also see, Swapcase in Python, And  Convert String to List Python

Upgrading Python on MacOS

This can be installed using the installer. Follow the steps below:

1. Open the Mac terminal using the spotlight. Write the below command to check the currently installed version of Python:

python3 --version


Output:

initial version


2. Now go to this site to download the installer for Mac and download the latest version:

download page


3. Run the installer and install Python. No PATH update is required:

installer


4. Run the below command to check the upgraded version:

python3 --version

 

Output:

latest version

gzip command in linux

Frequently Asked Questions

Can I have multiple Python versions installed on my system?

Yes, we can have multiple Python versions installed on our system simultaneously. However, we need to ensure that our applications use the correct version of Python by setting the PATH environment variable or using virtual environments.

Is uninstallation of previous versions of Python needed before upgrading?

No, we don't need to uninstall the previous version of Python before upgrading. The new version will overwrite the existing one and preserve our installed packages and configurations.

How do I check my current Python version?

We can check our current Python version by opening a command prompt or terminal and running the "python --version" command or “python3 --version”.

Can I downgrade my Python version if I encounter compatibility issues?

Yes, we can downgrade our Python version if we encounter compatibility issues with our applications or packages. However, it's recommended to back up our data and configurations and consult the package documentation before downgrading.

How often should I upgrade my Python version?

It's recommended to upgrade the Python version regularly, preferably every six months to a year, to take advantage of the latest features and improvements and ensure compatibility with the latest libraries and frameworks.

How do I change the version of Python in CMD?

To change the version of Python in CMD (Command Prompt), you can use the py command followed by the desired version number. For example, py -3.8 will switch to Python 3.8 if it's installed.

Conclusion

This article discussed how to upgrade Python version in various operating systems, including Windows, macOS and Linux. Upgrading our Python version is essential to take advantage of new features, bug fixes, and security enhancements. It also ensures compatibility with the latest libraries and frameworks and can improve the performance of our Python applications. 
 For more information on Python, check out our other blogs:

Live masterclass