1、下载命令:wget https://www.python.org/ftp/python/3.6.3/Python-3.6.3.tgz;
2、安装需要用到的组件:gcc、zlib-devel、openssl-devel等
检查是否已经安装:
rpm -aq | grep gcc
rpm -aq | grep zlib-devel
rpm -aq | grep openssl-devel
安装方式:
yum -y install gcc
yum -y install zlib-devel
yum -y install openssl-devel
3、解压:tar -zxvf Python-3.6.3.tgz;
4、 cd Python-3.6.3
./configure --prefix=/usr/local/python3,安装到/usr/local/python3下
make && make install
5、配置python3:ln -s /usr/local/python3/bin/python3 /usr/local/bin/python3
6、配置pip3:ln -s /usr/local/python3/bin/pip3 /usr/local/bin/pip3
7、验证是否安装好:
python3
pip3 -V
8、利用pip下载第三方库:pip3 install pymysql