ubuntu16.04 install python3.6 and switch to the default version

Ubuntu16.04 install python3.6 and switch to the default version (try it yourself)


1. Installation steps

code show as below:

sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt-get update
sudo apt-get install python3.6

2. Set as the default version

code show as below:

sudo update-alternatives --install /usr/bin/python python /usr/bin/python2.7 1
sudo update-alternatives --install /usr/bin/python python /usr/bin/python3.6 2
sudo update-alternatives --config python
[python3.6对应的序号]+Enter

3. Install the corresponding pip for python

code show as below:

curl https://bootstrap.pypa.io/ez_setup.py -o - | python3.6 && python3.6 -m easy_install pip

4. View the version

code show as below:

python

insert image description here

Guess you like

Origin blog.csdn.net/qq_50598558/article/details/114289351