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