Install Python3 under Linux

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.