How to install Python3.5 in CentOS

Source: Internet
Author: User
Tags centos

Method 1: Online installation

# Download Python source)
$ Wget https://www.python.org/ftp/python/3.5.1/Python-3.5.1.tar.xz

# Extract Python package ):
$ Tar xf Python-3.5.1.tar.xz

$ Xz-d Python-3.5.1.tar.xz

$ Cd Python-3.5.1

# Compiled Python (Compile Python ):
$./Configure

# Make:
$ Make

# Install ):
$ Make install

# Check Python version ):
$ Which python3.5
/Usr/local/bin/python3.5


Method 2: Another installation method

1. Download the python installation package from the official website.

The latest python version 3.2.2: Python-3.2.2.tgz is downloaded here

After the download, the file directory is under/home/python/, which is also the installation directory of my python


2. Decompress the package:

[Root @ www python] # tar zxvf Python-3.2.2.tgz


3. Open the installation directory and execute:

[Root @ www python] # cd Python-3.2.2.

[Root @ www Python-3.2.2] #./configure

[Root @ www Python-3.2.2] # make

[Root @ www Python-3.2.2] # makeinstall

The installation is complete.


4. If you enter the "python" command, the system still displays the old version. Therefore, you need to create a soft connection:

[Root @ www bin] # cd/usr/bin

[Root @ www bin] # ll | grep python

[Root @ www bin] # rm-rf python

[Root @ www bin] # ln-s/home/python/Python-3.2.2/python

[Root @ www bin] # python

Python 3.2.2 (default, Oct 26 2011, 23:40:16)

[GCC 4.1.2 20071124 (Red Hat 4.1.2-42)] on linux2

Type "help", "copyright", "credits" or "license" for more information.

>>>

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.