CentOS Upgrade Python3.x&pip3__python

Source: Internet
Author: User

Objective:

I currently use the server for the centos6.x system from the Python version of the 2.6.x, but at present, whether learning or using Python,python3 are preferred, then the problem comes. --How to install the PYTHON3 environment, and how to Python3 install the corresponding PIP3 it. What is more critical is that there are some tools in our original system that need to use the python2.6 version, so python3 and python2 are required to coexist, PIP2 and PIP3 coexist. The following article is my personal practice. (Install PIP3 for python3) 0. Installation dependence

Yum Install openssl-devel-   y

yum install zlib-devel-  y
I. Installation of Python3

1: Download the installation package:

2: Unpack the installation package:
TAR-ZXVF python-3.4.3.tgz
3: Enter after the decompression directory:
CD Python-3.4.3
4: Create the installation directory:
mkdir/usr/local/python3.4
5: Compile the installation:
./configure–prefix=/usr/local/python3.4
6: Execution:
Make && make install
7: The installation of the new version has been completed at this time, but because the old version is still in the system, you need to change the original/usr/bin/python link to a new connection: A. Modify the old connection first, execute: Mv/usr/bin/python/usr/bin/python_bak. B. Creating a new connection: Ln-s/usr/local/python3.4/bin/python3.4/usr/bin/python (This is not recommended, will cause the Yum tool to be used, it is best to recommend the generation of soft connections python3)
7.ln-s/usr/local/python3.4/bin/python3.4/usr/bin/python3 (recommended)
8: Query python version, execute:
Python3
Python 3.4.3 (default, Nov 9 2016, 14:41:47) Two, install PIP3

1: Installation dependencies

Yum Install openssl-devel-   y

yum install zlib-devel-  y

2: Install Setuptools

wget--no-check-certificate  HTTPS://PYPI.PYTHON.ORG/PACKAGES/SOURCE/S/SETUPTOOLS/SETUPTOOLS-19.6.TAR.GZ#MD5 =c607dd118eae682c44ed146367a17e26

tar-zxvf setuptools-19.6.tar.gz

cd setuptools-19.6.tar.gz

Python3 setup.py build

python3 setup.py Install

3: Install PIP

wget--no-check-certificate  https://pypi.python.org/packages/source/p/pip/pip-8.0.2.tar.gz#md5= 3a73c4188f8dbad6a1e6f6d44d117eeb

tar-zxvf pip-8.0.2.tar.gz

cd pip-8.0.2

python3

Build Python3 setup.py Install

Ref:http://www.cnblogs.com/wenchengxiaopenyou/p/5709218.html

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.