Centos7 安装python3

时间:2021-04-10 10:03:17

Centos7 安装python3

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#安装sqlite-devel
yum -y install sqlite-devel
 
#安装依赖
yum -y install make zlib zlib-devel gcc-c++ libtool  openssl openssl-devel
 
#下载安装
wget https://www.python.org/ftp/python/3.6.1/Python-3.6.1.tgz
mkdir -/usr/local/python3
tar -zxvf Python-3.6.1.tgz
cd Python-3.6.1
./configure --prefix=/usr/local/python3
make
make install
 
#软连接
ln -/usr/local/python3/bin/python3 /usr/bin/python3
 
#环境
vim ~/.bash_profile
    PATH=$PATH:$HOME/bin:/usr/local/python3/bin
    export PATH
source ~/.bash_profile