How do i upgrade to python 3?
Introduction Show
Every fresh Python release comes with bug fixes and new features. Python 3.9, the latest point release at the time of writing, comes with features such as improved time zone support, dictionary updates, and more flexible decorators. This tutorial shows you how to upgrade Python to version 3.9 on all the major operating systems - Windows, macOS, and Linux. Prerequisites
Note: If you are upgrading from a Python 2 release and do not have Python 3 installed, read our comprehensive guides on how to install it on:
Upgrading Python on Windows OSTo upgrade Python on Windows, download the installer or search for the app in the Microsoft Store. Upgrade to Python 3 with the Installer1. In your browser, visit the Python Releases for Windows section on the official Python website. 2. Click the Download Python button to download the installation file on your computer. 3. Next, run the Python installer. If you are upgrading from another point release of Python 3 (for example, 3.8.10), the installer suggests to install Python 3.9. Select Install Now to install Python with recommended options, or select Customize Installation to pick the install location and features. If you already have an older version of the same Python release (for example, 3.9.1), the installer offers to upgrade your Python installation. Proceed by selecting Upgrade Now. 4. When the installation finishes, check whether the new version of Python has been installed successfully. Open Windows PowerShell and type:
The output should show the latest version of Python, as in the image below. Install Python 3.9 from the Microsoft StoreIf you want to use Python 3.9 to learn the basics or test some simple concepts, find and install the Python 3.9 app from the Microsoft Store. 1. Go to Microsoft Store and type Python in the search field. 2. Select Python 3.9 from the search results that appear. 3. Click the Get button to start the installation. Start the interactive Python 3.9 experience by finding the app in the Start Menu. Upgrading Python on macOSOn macOS, Python can be installed, upgraded, and maintained using the command line interface or the GUI. Upgrade Python using HomebrewInstall Python in the macOS terminal using the Homebrew package manager. If you do not have Homebrew, install it by typing the following script in the terminal:
Then, proceed with the steps: 1. Update Homebrew by running:
2. If you are upgrading from Python 2, install Python 3 with the command:
If you already have a version of Python 3 installed, upgrade the package with the
Upgrade Python with the Installer1. In your browser, navigate to the Python Releases for macOS page, on Python's official website. 2. Click the link to download the latest Python 3 release on your computer. 3. Run the installer. Go through the installation steps by clicking Continue, agreeing to the License, and confirming the installation location and type. 4. Once the installation is complete, select Close. 5. Finally, confirm that the new Python version has been successfully installed by typing the following in terminal:
The output should display the latest version of Python. Upgrading Python in LinuxThis article
uses Ubuntu and its APT package manager to upgrade Python. If you are using a different Linux distribution, replace the Warning: Many Linux systems have Python 2 installed as the system version. Removing Python 2 could cause a system error. If you
are planning to install Python 3 on Linux, install it alongside Python 2 and invoke it with the 1. Start by updating the repositories:
2. Next, install Python 3.9 by running:
When prompted, type Y to start the installation. 3. Once Python installs, invoke the 3.9 version by running:
4. However, checking the installation with the
5. Now add the new version:
6. Next, type the following command to configure the priority status of the versions:
The output displays the available choices and their assigned number (in the example below, the numbers are 0, 1, 2). Type the number of the the version you wish to use and press Enter. 7. If you are not planning to use the old version of Python, remove the symlink that contained the previous Python 3 version with:
8. Then, replace the symlink with the new version:
9. Now, check the default version:
The output should confirm the successful installation and setup of the latest available version. Why Should You Upgrade Python?Since Python 3 was not a backward-compatible release, for a long time Python 2 remained the version of choice for those who wanted a stable development environment. Some services like Google App Engine did not support Python 3 for a long time. However, given that the official support for the final Python 2.7 release has ended, upgrading to Python 3 is now strongly recommended. Python 3 is faster, and its syntax is more user-friendly. If you already work with Python 3, upgrading to the latest point release gives you all the security updates and bug fixes. Conclusion After reading this tutorial, you should know how to upgrade your Python 3 version on Windows, macOS, and Linux. If you want to learn more about Python, read our article on Python data types. How can I update my Python version?Follow the below steps to update your python version:. Step 1: Go to Python's official site.. Step 2: Click on the Downloads tab.. Step 3: Download the version you need to upgrade to based on your system specifications(ie, 32-bit or 64-bit). ... . Step 4: Click on the installer and it will begin the installation.. How do I install the latest version of Python 3?Installing Python 3 on Linux. $ python3 --version. ... . $ sudo apt-get update $ sudo apt-get install python3.6. ... . $ sudo apt-get install software-properties-common $ sudo add-apt-repository ppa:deadsnakes/ppa $ sudo apt-get update $ sudo apt-get install python3.8. ... . $ sudo dnf install python3.. How do I install Python 3 on Windows 10?3 at the time of writing this article.. Step 1: Download the Python Installer binaries. Open the official Python website in your web browser. ... . Step 2: Run the Executable Installer. Once the installer is downloaded, run the Python installer. ... . Step 3: Add Python to environmental variables. ... . Step 4: Verify the Python Installation.. How do I update Python to latest version of Windows?To update Python in Windows using the Python installer, follow the below-mentioned steps carefully.. Step 1: Check Python Version. Firstly, check the current Python version using Command Prompt: ... . Step 2: Download Python Installer. ... . Step 3: Execute Python Installer. ... . Step 4: Install Python. ... . Step 5: Check Python Version.. |