搭建Linux环境--安装Python3.6
1、安装依赖
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
2、下载安装包(可以Windows下载https://www.python.org/downloads/也可以用wget 命令)
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
2、下载安装包(可以Windows下载https://www.python.org/downloads/也可以用wget 命令)
下载tgz 包
3、新建一个Python的安装目录:
3、新建一个Python的安装目录:
mkdir /root/pyrhon36
4、进入tgz包的路径解压:
4、进入tgz包的路径解压:
tar -vxzf Python-3.6.1.tar.gz
5、解压完成:
5、解压完成:
cd Python-3.6.1
6、指定Python的安装路径 :
6、指定Python的安装路径 :
./configure --prefix=/root/python36
7、make
8、make install
9、因为Linux默认安装Python2,需要修改软链接:
7、make
8、make install
9、因为Linux默认安装Python2,需要修改软链接:
ln -s /root/python36/bin/python3.6 /usr/bin/python3
10、修改pip的软链接:
10、修改pip的软链接:
ln -s /root/python36/bin/pip3 /usr/bin/pip3