Linux7 installation python3.5.4

1. First modify yum configuration file
because yum use python2, and therefore may not function properly after the replacement is python3, continue to use this python2.7.5
therefore modify yum configuration file (vi / usr / bin / yum ).
The file header #! / Usr / bin / python into a #! / Usr / bin / python2.7 can save out.

2. Installation depends python3.5 possible use of

yum install openssl-devel bzip2-devel expat-devel gdbm-devel readline-devel sqlite-devel

3. wget downloads

wget https://www.python.org/ftp/python/3.5.1/Python-3.5.1.tgz

Unzip tgz package

tar -zxvf Python-3.5.1.tgz

The python moved to / usr / local following

mv Python-3.5.1 /usr/local

• remove the old version of python dependence

ll /usr/bin | grep python

rm -rf /usr/bin/python

Enter python directory

cd /usr/local/Python-3.5.1/

• Configuration

./configure

Compile make

make

Compile, install

make install

Remove the old soft link to create a new soft link to the latest python

rm -rf /usr/bin/python

ln -s /usr/local/bin/python3.5 /usr/bin/python

python -V

See the Python 3.5.1 is the success

Error handling: https://blog.csdn.net/cuiljiang/article/details/88755825

Guess you like

Origin www.cnblogs.com/hoganhome/p/11593809.html
Recommended