我爱编程

centos安装python3

2018-04-13  本文已影响0人  SolaTyolo

centos自带的python是2.7的,但是2.7python已经逐渐被抛弃,纷纷转到python3le。故记录下centos安装python3的流程

先安装依赖包

yum -y 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

下载python3的包

wget https://www.python.org/ftp/python/3.6.2/Python-3.6.2.tar.xz

解压并安装

mkdir /usr/local/python3 
tar -xvJf  Python-3.6.2.tar.xz
cd Python-3.6.2
./configure --prefix=/usr/local/python3
make && make install

创建软链接

ln -s /usr/local/python3/bin/python3 /usr/local/bin/python3
ln -s /usr/local/python3/bin/pip3 /usr/local/bin/pip3
上一篇下一篇

猜你喜欢

热点阅读