Install Python 3.5.2 In CentOS 6.5 (coexist with Python2) and centospython2

Source: Internet
Author: User

Install Python 3.5.2 In CentOS 6.5 (coexist with Python2) and centospython2

This article describes how to install Python 3.5.2 In CentOS 6.5 and coexist with Python 2. For more information, see the following:

The installation procedure is as follows:

1. Prepare the compiling environment. (if the environment is incorrect, you may encounter various problems. For example, wget cannot download files connected to https)

yum groupinstall 'Development Tools'yum install zlib-devel bzip2-devel openssl-devel ncurses-devel

2. Download The Python3.5 code package

wget https://www.python.org/ftp/python/3.5.2/Python-3.5.2.tar.xz

3. Compile

tar Jxvf Python-3.5.2.tar.xzcd Python-3.5.2./configure --prefix=/usr/local/python3make && make install

4. Set Environment Variables

echo 'export PATH=$PATH:/usr/local/python3/bin' >> ~/.bashrc

5. Set the Directory

ln -sv /usr/local/python3/bin/python3.5 /usr/bin/python3

The purpose is to input python3 in any directory of the system to call the python3.5 command.

Install pip

Pip is installed based on the wiki on the official website.

1. Install setuptools. Install setuptools before installing pip, as shown on the above page.

Download and execute:

wget https://pypi.python.org/packages/source/s/setuptools/setuptools-5.7.zip --no-check-certificateunzip setuptools-5.7.zip cd setuptools-5.7python3 setup.py install
wget wget https://pypi.python.org/packages/source/p/pip/pip-7.1.2.tar.gz#md5=3823d2343d9f3aaab21cf9c917710196tar xvf pip-7.1.2.tar.gzcd pip-7.1.2python3 setup.py install

After installation, you can.

Summary

Well, let's talk about it first. The above is all the content of this article. I hope the content of this article will help you in your study or work. If you have any questions, please leave a message, thank you for your support.

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.