20170704-8 选题

This commit is contained in:
Ezio 2017-07-03 11:41:05 +08:00 committed by GitHub
parent 5371fc0634
commit 52e70f338a

View File

@ -0,0 +1,68 @@
Python 3.6 - install latest version into Linux Mint
============================================================
![Python 3.6 - install latest version into Linux Mint](https://mintguide.org/uploads/posts/2017-06/1496865727_python-logo.png)
**Python** is one of the most popular programming languages for [Linux][3]. It is written many different tools and libraries. In addition, Python is popular among developers because it is very easy and quick programming, and it's actually simple to master. [][1]If you have installed the operating system [Linux mint][4], you are learning the programming language **Python** and want to work with the latest version, then this article is for you.
Now I have installed [Linux Mint 18][5].1 and the default installed version 2.7 and 3.5\. You can check this with commands
```
TerminalShekin@mylinuxmintpc~$python -V
python2 -V
python3 -V
```
**Installation latest Python 3.6 version into Linux Mint**:
```
TerminalShekin@mylinuxmintpc~$sudo add-apt-repository ppa:jonathonf/python-3.6
sudo apt update
sudo apt install python3.6
```
Check the version of the installed Python 3.6
```
TerminalShekin@mylinuxmintpc~$python3.6 -V
```
**Please note** that the old version is still here, it still available by the name of **python3**and the new can now be loaded with the command **python3.6**. If you want to use this version instead of the 3.5 to run all the programs, there is a utility **update-alternatives**. But if you try to get a list of possibilities, we get the error:
[![Python 3.6 - install latest version into Linux Mint](https://mintguide.org/uploads/posts/2017-06/thumbs/1496871711_linux_mint_001.png)][6] This is normal, you need to first setup what files for that answer, because the maintainers did not care about it :
```
TerminalShekin@mylinuxmintpc~$sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.5 1
sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.6 2
```
Now look again:
```
TerminalShekin@mylinuxmintpc~$update-alternatives --list python3
```
[![Python 3.6 - install latest version into Linux Mint](https://mintguide.org/uploads/posts/2017-06/thumbs/1496871720_linux_mint_002.png)][7] Now we can choose the required version and switch as needed. For settings use the config command:
```
TerminalShekin@mylinuxmintpc~$sudo update-alternatives --config python3
```
[![Python 3.6 - install latest version into Linux Mint](https://mintguide.org/uploads/posts/2017-06/thumbs/1496871722_linux_mint_003.png)][8] In the prompt you need to specify the program number you want to use by default.
Be careful with a selection of versions, not to touch the python (python2), just use python3, as I said, Python 2.7 written in a variety of system tools, and if you try to run them the wrong version of the interpreter, then nothing happens.May the Force be with you,
Good Luck!!!
[python.org][9]
--------------------------------------------------------------------------------
via: https://mintguide.org/other/794-python-3-6-install-latest-version-into-linux-mint.html
作者:[ Shekin][a]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]:https://mintguide.org/user/Shekin/
[1]:http://www.codeweavers.com/?ad=708
[2]:https://mintguide.org/engine/dude/index/leech_out.php?a%3AaHR0cHM6Ly93d3cucHl0aG9uLm9yZw%3D%3D
[3]:https://mintguide.org/
[4]:https://mintguide.org/
[5]:https://mintguide.org/
[6]:https://mintguide.org/uploads/posts/2017-06/1496871711_linux_mint_001.png
[7]:https://mintguide.org/uploads/posts/2017-06/1496871720_linux_mint_002.png
[8]:https://mintguide.org/uploads/posts/2017-06/1496871722_linux_mint_003.png
[9]:https://mintguide.org/engine/dude/index/leech_out.php?a%3AaHR0cHM6Ly93d3cucHl0aG9uLm9yZw%3D%3D
[10]:https://mintguide.org/other/