There are many ways to upgrade Python on Ubuntu 16.04 on the Internet, but most of the tutorials use source installation methods. This blog post will use another method to upgrade the Python 3.5 that comes with the system to Python 3.6.
Anyone who has used Ubuntu 16.04 knows that there is no Python 3.6 installation package in the software source installation list of this version of Ubuntu, so we need to add the installation source and enter the following command on the command line:
sudo add-apt-repository ppa:jonathonf/python-3.6
After adding the Python 3.6 installation source to the system, enter the following command to update the software list:
sudo apt-get update
After updating the installation source, enter the following command to install Python 3.6:
sudo apt-get install python3.6
After the installation is complete, set the priority of Python 3.6 and enter the following command:
sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.51
sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.62
Next, let's update pip, enter the following code:
sudo apt-get install python3-pip
sudo pip3 install --upgrade pip
At this point, the python upgrade is complete
Recommended Posts