Install the dependencies that may be used by python3.5
yum install openssl-devel bzip2-devel expat-devel gdbm-devel readline-devel sqlite-devel
Go to the python official website to find the download path and use wget to download
wget https://www.python.org/ftp/python/3.5.3/Python-3.5.3.tgz
Unzip the tgz package
tar -zxvf Python-3.5.3.tgz
Move python to /usr/local
mv Python-3.5.3 /usr/local
Remove old versions of python dependencies
ll /usr/bin | grep python rm -rf /usr/bin/python
Enter the python directory
cd /usr/local/Python-3.5.3/
Configuration
./configure
Compile make
make
Compile and install
make install
Delete old soft links and create new soft links to latest python
rm -rf /usr/bin/python ln -s /usr/local/bin/python3.5 /usr/bin/python python -V
The above is the detailed content of How to install python3.5.3 under linux. For more information, please follow other related articles on the PHP Chinese website!