Linux under Installation Python3 and Python2 coexist
Linux under the default system comes with python2.6 version, this version is dependent on many system programs, so it is not recommended to delete, if using the latest Python3 compiled install Source package and system default package is not any effect, so can install Python3 and python2 coexistence
First, go to the Python website to download the Python version you need to install URL: https://www.python.org/
Installation code:
1, wget https://www.python.org/ftp/python/3.6.3/Python-3.6.3.tgz
2, unzip the downloaded file Tar-xvzf python-3.6.3.tgz
3. Enter the catalogue CD PYTHON-3.6.3.TGZ
4. Configure the Python directory under USR./configure--prefix=/usr/python
5, compile the source: make, perform the installation: make install
In order to facilitate the suggestion to rename first, and then set up a soft link can not specify the input python3.
Mv/usr/bin/python/usr/bin/python.bak #Python2/3 co-exist without changing
Ln-s/usr/python/bin/python3/usr/bin/python3 #指定路径到/usr/bin/python3
After the configuration is successful, PIP3 can not be used, further installation of PIP3 for configuration environment
Path= $PATH: $HOME/bin:
$HOME/bin:/usr/local/python3/bin
This article is from "Mr. Chen" blog, please be sure to keep this source http://10806943.blog.51cto.com/10796943/1974589
Linux installation Python