源代码编译安装Python3.5.2

由于没有找到Python3.5的rpm安装包,因此进行源代码编译安装

1、下载Python3.5.2

[root@seastar ~]# cd /usr/local/src

[root@seastar  src]#wget wget https://www.python.org/ftp/python/3.5.2/Python-3.5.2.tgz

2、查看安装步骤

[root@seastar src]# tar -zxvf Python-3.5.2.tgz

[root@seastar src]# cd Python-3.5.2

[root@seastar Python3.5.2]# cat README | more

On Unix, Linux, BSD, OSX, and Cygwin:

./configure

make

make test

sudo make install

3、安装

[root@seastar src]# ./configure --prerix=/usr/local/python3

...

3、编译

[root@seastar src]# make

...

Python build successfully!

The necessary bits to build these optional modules is not found:

_bz2  _curses  _curses_panel

_dbm  _gdbm  _lzma

_sqlite3  _ssl  _tkinter

readlime  zlib

安装这些可选的开发库(这里忽略了lzma和tkinter)

[root@seastar src]# yum install -y bzip2-devel ncurses-devel gdbm-devel openssl-devel readline-devel zlib-devel sqlite-devel

3、安装

[root@seastar src]# make install

...

4、至此,安装成功

上一篇:CentOS 7编译安装Python3.7.X


下一篇:opensuse编译安装Python3后缺少zlib