CentOS6/CentOS7安装Python3.6.4

转自:https://wiki.olvps.com/?p=421

 

1.获取编译包:
注意请先安装依赖

yum -y install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-devel
wget https://www.python.org/ftp/python/3.6.4/Python-3.6.4.tgz

2.解压:

tar -zxvf Python-3.6.4.tgz
3.移动到安装目录

mv Python-3.6.4 /usr/local
4.进入目录:

cd /usr/local/Python-3.6.4
5.编译安装:

./configure
make
make install

6.软链接:

ln -s /usr/local/bin/python3.6 /usr/bin/python3
大功告成:

python3 -V

 

  • 234 Users Found This Useful
這篇文章有幫助嗎?

相關文章

无法wget或者下载github的文件

引起这个的原因一般为DNS污染,例如下图所示: 临时解决办法为设置hosts,让他解析为正确的IP。 可以使用以下设置: echo "151.101.228.133...

CentOS7卸载firewalld开启iptables

service firewalld stop chkconfig firewalld off yum remove firewalld -y yum install...