centos安装python3
Posted ianxu
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了centos安装python3相关的知识,希望对你有一定的参考价值。
安装必要的包
yum groupinstall ‘Development Tools‘
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.6/Python-3.6.6.tar.xz
解压
tar -xvJf Python-3.6.6.tar.xz
配置安装
./configure --prefix=/usr/local/python3 --with-ssl --enable-shared --enable-optimizations
make && make install
软连接
ln -s /usr/local/python3/bin/python3 /usr/bin/python3
ln -s /usr/local/python3/bin/pip3 /usr/bin/pip3
以上是关于centos安装python3的主要内容,如果未能解决你的问题,请参考以下文章