0

A Guide to Upgrade Your Python to 3.9 🐍

 2 years ago
source link: https://levelup.gitconnected.com/a-guide-to-upgrade-your-python-to-3-9-44ccb3eae31a
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

A Guide to Upgrade Your Python to 3.9 🐍

Python 3.9 Has Released (October 5, 2020)! Let’s Install it!

Photo by David Clode on Unsplash

Since 2020–10–05, the new version of Python (3.9) was released with some new features and optimizations such as Union Operators in dict, Type Hinting Generics In Standard Collections, Flexible function, and variable annotations, and much more.

This article will show you a tutorial on how to update your Python to 3.9 in an easy way for Windows, Mac, and Linux operating systems.

Window OS

Simply download and install the Python 3.9 installer from the Python download page. And you are not sure which version is for you. I would recommend going for Windows x86–64 executable installer version or you can simply click this link.

1*W1M1pOdMEXzsSfTpDC2kEA.png?q=20
a-guide-to-upgrade-your-python-to-3-9-44ccb3eae31a
Recommended Python Installer (Screenshot from the Python Download page)

You may check on the “Add Python to Path” option while installing to register Python3.9 as the main python on your system

$ python --version
Python 3.9.0

MAC OS

For macOS, you may do the same as in Windows OS by downloading from the Python download page. And then you can check your python version as example commands below:

$ python --version
Python 2.x.x$ python3 --version
Python 3.9.0

Optionally, if you want this new python version to be run with python command instead of python3 , you can add an alias in the .bash_profile file in your $HOME directory. You can do this by just open the terminal and use the following commands:

$ cd $HOME
$ nano .bash_profile

Then, add this line at the end.

alias python="python3"

Now, you can execute python 3.9 with python .

$ python --version
Python 3.9.0

LINUX

In LINUX, you may use the following commands:

$ sudo add-apt-repository ppa:deadsnakes/ppa
$ sudo apt update
$ sudo apt install python3.9

Then, you can check your new and existing Python installation version as commands below:

$ sudo python --version
2.x.x
$ sudo python3 --version
3.8.x
$ sudo python3.9 --version
3.9.0

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK