释放双眼,带上耳机,听听看~!
1,安装依赖包与其他依赖包
1
2
3
4 1yum -y install gcc
2yum -y install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-devel libffi-devel
3
4
2,下载
1
2
3 1wget https://www.python.org/ftp/python/3.6.8/Python-3.6.8.tgz
2
3
3,解压并且移动到 /usr/local/ 目录
1
2
3
4
5 1tar -zxvf Python-3.6.8.tgz
2mv Python-3.6.8 /usr/local/
3cd /usr/local/Python-3.6.8/
4
5
4,建立一个空文件夹,用于存放python3程序
1
2
3 1mkdir /usr/local/python3
2
3
5,执行配置文件,编译,编译安装
1
2
3
4 1./configure --prefix=/usr/local/python3
2make && make install
3
4
6,建立软链接
1
2
3
4 1ln -s /usr/local/python3/bin/python3.6 /usr/bin/python3
2ln -s /usr/local/python3/bin/pip3.6 /usr/bin/pip3
3
4
7,测试是否安装成功
1
2
3 1python3
2
3
输出版本号表示安装成功了