Linux installation Python

Source: Internet
Author: User

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

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.