Centos7安装python3并与python2共存
1.安装必要工具
yum -y install net-tools
yum -y install wget
2. 安装相关包
yum install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gcc make
3.下载Python3
wget https://www.python.org/ftp/python/3.6.2/Python-3.6.2.tar.xz
4.解压
tar -xvJf Python-3.6.2.tar.xz
5.切换进入
cd Python-3.6.2
6.编译安装
./configure prefix=/usr/local/python3
make && make install
7.python3安装完毕,/usr/local/目录下就会有python3了 因此我们可以添加软链到执行目录下/usr/bin
ln -s /usr/local/python3/bin/python3 /usr/bin/python3
相关推荐
chuckchen 2020-10-31
Will0 2020-10-12
Dreamhome 2020-10-09
xirongxudlut 2020-09-28
星辰大海的路上 2020-09-13
chaochao 2020-08-31
猪猪侠喜欢躲猫猫 2020-08-17
快递小可 2020-08-16
shengge0 2020-07-26
巩庆奎 2020-07-21
张文倩数据库学生 2020-07-19
xirongxudlut 2020-07-18
Ericbig 2020-07-18
kyelu 2020-07-09
liangzhouqu 2020-07-07
GuoSir 2020-06-28
chaigang 2020-06-27
pythonxuexi 2020-06-25