1, download python3.5
wget https://www.python.org/ftp/python/3.5.0/Python-3.5.0.tgz
Note: If downloading is slow in Linux, you can download it from the Windows operating system to the Python website: https://www.python.org/downloads/release/python-350/
Note To download the gzipped source tarball version, and then use WINSCP to drag the downloaded file python-3.5.0.tgz to Linux, the next step remains unchanged.
2, decompression
Tar zxvf python-3.5.0.tgz
3, into the Python-3.5.0 folder
CD Python-3.5.0
4. Configure Installation Location
./configure--prefix=/usr/local/python3.5
Note: If you do not install the C language compiler, you will be prompted for an error. If an error occurs, install the GCC compiler using the Yum install GCC command on networking
5, compile
Make
6, installation
Make install
7, download and install Setuptools 18.5
wget Https://bootstrap.pypa.io/ez_setup.py-O-| Python
Note: If prompted for error--no-check-certificate
After wget add--no-check-certificate:wget--no-check-certificate Https://bootstrap.pypa.io/ez_setup.py-O-| Python
8, backup the original Python command execution file
Mv/usr/bin/python/usr/bin/pythonbak
9. Create a new Python soft connection
Ln-s/usr/local/python3.5/bin/python3.5/usr/bin/python
10. View Python version
Python
[root@localhost python-3.5.0]# python
python 3.5.0 (default, OCT 7 2016, 04:34:35)
[GCC 4.4.7 20120313 (Red H At 4.4.7-17)] on Linux
Type ' help ', ' copyright ', ' credits ' or ' license ' for the more information.
11, modify the Yum configuration file
Vim/usr/bin/yum
#!/usr/bin/python python modified to python2.6
import sys
try:
import yum
except Importerror:
print > > Sys.stderr, "" "\
There is a problem importing one of the Python modules
required to run yum. The error leading to this problem is:
%s Please
install a package which provides this module, or
verify that The module is installed correctly.
It's possible that's above module doesn ' t match the current
version of Python, which are:
%s
If you cannot Solve this problem yourself, "go to the
" Yum FAQ at: