《Centos安装Python3.7》
mail:mslinux@163.com
文档作者:马帅
系统环境:CentOS 7.5 64.bit
安装依赖包
[root@localhost ~]# yum install zlib-devel bzip2-devel openssl-devel ncurses-devel libffi-devel readline-devel
libffi-devel这个包很重要的没有这个包make install会报错的
readline-devel 是防止进入python的shell时返回键不能用
安装python3.7
[root@localhost ~]# wget https://www.python.org/ftp/python/3.7.1/Python-3.7.1.tar.xz
[root@localhost ~]# tar Jxvf Python-3.7.1.tar.xz
[root@localhost ~]# cd Python-3.7.1/
[root@localhost Python-3.7.1]# ./configure --prefix=/usr/local/python3 && make && make install
[root@localhost Python-3.7.1]# cd
[root@localhost ~]# vim .bash_profile
#.bash_profile
Get the aliases and
functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi