Pro-test valid for 7 lightweight Ali cloud server centos
python ==> 3.7.4
pip ==> 3
First, open the python's official website, download the Python find the tgz file, there are two ways to download ( version may be updated into the official website to verify the subject )
1, directly under the windows system finished by xtfp upload files to / usr / local / under
Download python official website:
https://www.python.org/downloads/release/python-374/
2, the wget command, as the second half of the download link command, just right-click on the link to copy Gzi ......
wget https://www.python.org/ftp/python/3.7.4/Python-3.7.4.tgz
Second, unzip the file, add some install dependencies
Decompression in / usr / local / directory (as used to be here to download the file, unzip place, based on individual circumstances)
tar zxvf Python-3.7.4.tgz
Installation depends
yum -y install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-devel gcc libffi-devel gcc make automake autoconf libtool libffi-devel
And the need to install a package, libffi-devel package is a new version 3.7 required, otherwise errors when installing the
ModuleNotFoundError: No module named '_ctypes'
yum install libffi-devel -y
Into the extracted directory
cd Python-3.7.4
Initial configuration
Note: Prior to first install directory is created, otherwise ......., here I installed under / usr / local / python3 directory
mkdir /usr/local/python3
./configure --prefix=/usr/local/python3
Perform the installation
make && make install
The installation is complete on the configuration software connection
ln -s /usr/local/python3/bin/python3 /usr/bin/python3
ln -s /usr/local/python3/bin/pip3 /usr/bin/pip3
verification
1 python3 - V 2 3 pip3 -V
Upgrade pip3 (pip3 need to be updated frequently to say)
pip3 install --upgrade pip
ok everything is completed