Centos7-安装py3

安装依赖

yum install gcc openssl-devel bzip2-devel expat-devel gdbm-devel readline-devel sqlite-devel libffi-devel tk-devel wget curl-devel -y

wget下载链接

cd /tmp
wget https://www.python.org/ftp/python/3.7.4/Python-3.7.4.tgz

解压tgz包

tar -zxvf Python-3.7.4.tgz

编译安装

cd Python-3.7.4
./configure prefix=/usr/local/python3
make && make install

创建软链接

ln -s /usr/local/python3/bin/python3 /usr/bin/python3
ln -s /usr/local/python3/bin/pip3 /usr/bin/pip3

posted @ 2019-10-05 00:50  kylingx  阅读(243)  评论(0编辑  收藏  举报