How to update Python

updating Python

Let’s discuss various ways to update the Python on your PC.

Updating Python in Windows

The first step is to open the cmd and check the python version on the terminal by typing the following command.

$ Python

In our case, it displays version 3.6.4 as follows

Python 3.6.4
Python 3.6.4

Update Python 3.6.4 to 3.9.0 in Windows

We intend to update Python from the current version 3.6.4 to version 3.9.0.

To do so, we access https://www.python.org/, the official website for Python, and go to the downloads section. Then choose windows from the sub-menu.

In this case, the first option is ideal from the available list because it indicates the “Latest Python 3 Release -Python 3.9.0”. I click on the hyperlink, which presents various distributions of Python 3.9.0.

I select the windows X86-64 executable installer.

Running the executable file

After the download process is complete, I open it, and I am prompted by the question, “Do you want to run this file?”

are you sure you want to run this file
are you sure you want to run this file

I choose the option run, which presents a second interface.

The window presents two alternatives to upgrade to Python 3.6.4 (64-bit). The first option will maintain my already existing settings when it upgrades now.

The second alternative that is more flexible allows me to customize by enabling or disabling certain features.

Upgrade Now

Select the more comfortable option, which is “Upgrade Now.” What follows is the installation process that will appear as shown below.

Python Installation Progress
Python Installation Progress

When the installation is successful the following window will appear.

Python Successful Installation Page

Click on the windows button and type in Python, press enter. The subsequent window presents the latest updated version of Python, as shown below.

Python updated to version 3.9.2
Python updated to version 3.9.2

And that is how simple it is.

Upgrade Python 3.8 to 3.9 Ubuntu

Adding Python 3.9.2 to the repository

The Latest Python 3.9.2 is not already available in ubuntu’s default repositories. Thus, it calls for additional storage.

We will use the dead snakes repository known for python packages on the launchpad.

How to Add dead snakes repository to ubuntu

sudo add-apt-repository ppa:deadsnakes/ppa

Then update the package list as follows

$ sudo apt-get update

How to verify the existence of the updated python packages list

To verify if the updated Python packages appear in the list, run the following command.

sudo apt list | grep python3.9.2

The output shows that Python 3.9.2 is now available for installation

How to install Python 3.9.2

First, add Python 3.9.2 to update-alternatives by running the following command.

sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.9.2

To change the default python 3.8 from pointing to python 3.8 because by default we want to execute python3.9.2, run the following command

sudo update-alternatives --config python3

Next is to check the current version of Python as follows

$ python3 -V

In our test, the results were as follows

Python 3.9.0+

Similar Posts

  • How to list the python-kinds in ctags

    Ctags is a handy tool for navigating any programming language’s source code. Ctags parses identifiers, methods, classes, and other elements from the source code and saves the index in a tag file. Each tag is kept in its line. Ctags is a program that is supported by a wide range of programming languages. Functions, variables, class members, macros, and other items may be indexed depending on the language. These tags allow a text editor, a code search engine, or another utility to quickly and readily discover definitions.

  • Working with Dictionaries in Python

    This definitive guide to Python Dictionaries will help you learn everything you know about the Python Dictionary and its capabilities. You’ll also learn how to use the dictionary to establish word frequency. A mutable dictionary is a built-in Python Data Structure. In spirit, it’s similar to List, Set, and Tuples. It is, however, not indexed by a sequence of numbers but keys and can be thought of as associative arrays. It consists of a key and a value on a more abstract basis. The Dictionary in Python represents a hash-table implementation.

  • Python range function

    The range() method in Python returns the sequence of a number inside a given range. Python has a built-in function called range(). When a user needs to repeat an action a certain number of times, this is the method to utilize. range() in Python 3.x is simply a renamed version of the Python method xrange (2.x). The range() method is used to create a numeric sequence.

  • How to upload and download files using Flask

    Flask is one of the most popular frameworks for backend development. It is a microframework based on the python programming language. Instead, a micro-framework Flask is very powerful and is highly extensible. Since Python is popular for Machine Learning and Data Science, Flask is hugely used to serve Machine Learning and Data Science related apps. In this tutorial, we will learn how to create a file uploader and file downloader using Flask.

Leave a Reply

Your email address will not be published. Required fields are marked *