Install Python 3.5.2 (coexisting with Python2) under CentOS 6.5

Source: Internet
Author: User

Installation of Python 3.5.2 (coexisting with Python2) under CentOS 6.5 installation steps
  • 1, prepare to compile the environment (the environment is not correct, you may encounter various problems during the installation process.) For example, wget cannot download linked files)

    Yum ' Development Tools ' Yum Install bzip2-devel openssl-devel ncurses-devel

  • 2, download Python3.5 source package

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

  • 3, compiling

    Tar JXVF python-3.5. 2. Tar . XZCD Python-3.5. 2 . /configure--prefix=/usr/local/python3make make andinstall

    --prefix Specifying the installation path

    If you do not specify prefix,
    The executable file is placed by default in the/user/local/bin
    The library file is placed by default in the/usr/local/lib
    The configuration file is placed by default in the/usr/local/etc
    Other resource files are placed by default on the/usr/local/share
    To uninstall this program, either make uninstall in the original make directory (if the make file has specified uninstall), or go to the above directory to delete the relevant files by hand

    Specify prefix, delete a folder directly is enough.

  • 4, setting environment variables

    Echo ' export path= $PATH:/usr/local/python3/bin ' >> ~/.BASHRC

    ~/.bashrc: This file contains bash information dedicated to your bash shell, and when you log in and every time you open a new shell, the file is read
    The above command implementation: will be export PATH=$PATH:/usr/local/python3/bin added to the end of the ~/.bashrc file

  • 5, setting the directory

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

    The purpose of this: to Python3 in any directory of the system, call the python3.5 command

Install PIP
    • When the pyhon3.5 is installed, it already has a PIP and uses it.pip3
This is installed according to the website wiki.
  • 1, install Setuptools. You need to install Setuptools before PIP is installed.

    wget https://Pypi.python.org/packages/source/s/setuptools/setuptools-5.7.zip-- No-check-certificateUnzip setuptools-5.7. Zip CD Setuptools-5.7Install

    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. 2  Install

Install Python 3.5.2 (coexisting with Python2) under CentOS 6.5

Related Article

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.