A long time ago in the Linux environment to learn python, today is nothing to do the first Python3 installed.
I use the Linux system is centos6.5, the default with Python2, but Python2 and Python3 is still a big difference, so use Python3 as a learning environment.
The compile and install steps are as follows:
1. cd /usr/local/src #切换到这个目录下
2. Find the Python file to download on the Python official website, because it is Linux, so I choose the source code installation, such as:
3. Find the appropriate version of the download
4. Get the address URL https://www.python.org/ftp/python/3.6.3/Python-3.6.3.tgz
Execute under 5.linuxwget https://www.python.org/ftp/python/3.5.3/Python-3.6.3.tgz
6. Unzip:tar -xzvf Python-3.6.3.tgz
7. Go to the Directorycd Python-3.6.3/
8. Execute ./configure --prefix=/usr/python me here without prior installation GCCC An error has occurred, executed yum install -y gcc and then re-executed./configure --prefix=/usr/python
9. Implementationmake && make install
10. The original python in the system/usr/bin/python, through Ls-l can see, Python is a soft link (lrwxrwxrwx), Link to the python2.6 in this directory, so will this soft connect its deleted, re-establish a soft connection to point to the new Python3.6.3
rm -rf /usr/bin/python
ln -s /usr/local/bin/src/Python3.6.3/python /usr/bin/python
11. The terminal input Python command will show the relevant information of Python3, which also indicates that we write source installation Python3 success!
Install Python3 under Linux