Install python3.5

Installation depends python3.5 possible use of

[root@heweiwei heweiwei]# yum install openssl-devel bzip2-devel expat-devel gdbm-devel readline-devel sqlite-devel

Python official website to find the download path, use wget to download

[root @ heweiwei heweiwei] # wget https://www.python.org/ftp/python/3.5.1/Python-3.5.1.tgz

Unzip tgz package

[Root @ heweiwei heweiwei] # tar -zxvf Python-3.5.1.tgz

The python moved to / usr / local following

[Root @ heweiwei heweiwei] # mv Python-3.5.1 / usr / local

Remove the old version of python dependence

[root@heweiwei heweiwei]# ll /usr/bin | grep python
-rwxr-xr-x. 1 root root 20152 May 12 2016 abrt-action-analyze-python
-rwxr-xr-x. 2 root root 9032 Au 大专栏  安装python3.5g 18 2016 python
lrwxrwxrwx. 1 root root 6 Feb 27 16:05 python2 -> python
-rwxr-xr-x. 2 root root 9032 Aug 18 2016 python2.6
-rwxr-xr-x. 1 root root 1418 Aug 18 2016 python2.6-config
lrwxrwxrwx. 1 root root 16 Feb 28 17:21 python-config -> python2.6-config

[Root @ heweiwei heweiwei] # rm -rf / usr / bin / python

Enter python directory
[root @ heweiwei heweiwei] # cd /usr/local/Python-3.5.1/
[root @ heweiwei Python-3.5.1] #

Configuration

[root@heweiwei Python-3.5.1]# ./configure

Compile make

[root@heweiwei Python-3.5.1]# make

Compile, install

[root@heweiwei Python-3.5.1]# make install

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

[root@heweiwei Python-3.5.1]# rm -rf /usr/bin/python
[root@heweiwei Python-3.5.1]# ln -s /usr/local/bin/python3.5 /usr/bin/python

View version

[heweiwei heweiwei @ ~] $ -V Python
Python 3.5.1

Guess you like

Origin www.cnblogs.com/lijianming180/p/12037961.html