网址
安装
-
编译环境安装
yum install gcc -y
yum install gcc-c++ -y
yum install openssl-devel -y
yum install zlib-devel -y
-
创建文件夹
mkdir /usr/local/python3
-
解压
tar -vxf Python-3.6.0.tgz
-
安装
./configure --prefix=/usr/local/python3
make
make install
-
软连接修改
mv /usr/bin/python /usr/bin/python_bak
ln -s /usr/local/python3/bin/python3 /usr/bin/python
-
yum修改
vi /usr/bin/yum
#!/usr/bin/python2.6
-
pip安装
下载地址
tar -vxf pip-18.0.tar.gz
cd pip-18.0
python setup.py build
python setup.py install
ln -s /usr/local/python3/bin/pip3 /usr/bin/pip3