Ubuntu16 upgrade Python3

Many online upgrade method Ubuntu16.04 Python, but most of all tutorials use the source code installation. This blog will use another method to upgrade the system comes Python3.5 to Python3.6.
Used Ubuntu16.04 people know, this version of the list of installed software source Ubuntu is not installed the package Python3.6, so we need to add the installation source, enter the following command at the command line:

the Add-APT-Repository the sudo PPA: jonathonf / Python-3.6
. 1
After adding into the system installation source Python3.6, enter the following command to update software list:

APT-GET Update the sudo
. 1
after update installation source, enter the following command to install Python3.6:

APT-GET python3.6 the install the sudo
. 1
after installation, set priorities, enter the following command Python3.6 of:

Alternatives --install-Update the sudo / usr / bin / /usr/bin/python3.5. 1 to python3 to python3
the sudo-Update Alternatives --install / usr / bin / 2 to python3 to python3 /usr/bin/python3.6
. 1
2
Next we update the pip, enter the following code:

APT-GET install python3 sudo-PIP
sudo install --upgrade PIP PIP3
1
2
At this point, python upgrade is complete

 

When you install the module may use pip3 error:

Traceback (most recent call last):
File "/usr/local/bin/pip3", line 7, in <module>
from pip._internal import main
ModuleNotFoundError: No module named 'pip._internal'
解决办法(编辑/usr/local/bin/pip3文件):

sudo vim /usr/local/bin/pip3
将from pip._internal import main 改成 from pip import main

 

Guess you like

Origin www.cnblogs.com/zpaixx/p/11311171.html