参考:https://www.cnblogs.com/Guido-admirers/p/6259410.html
1.官网下载python3
cd /home/download
wget https://www.python.org/ftp/python/3.6.0/Python-3.6.0.tgz
2. 解压到指定目录
mkdir /user/local/python3
tar -xvf Python-3.6.0.tgz -C /user/local/python3
3. 编译、安装
./configure --prefix=/usr/local/python3 #设置安装路径
make
make install
4. 创建新的软连接
ln -s /usr/local/python3/bin/python3 /usr/bin/python3
5、检查python是否安装成功
python3 -V
python-3.6.0
python2与python3共存之后 pip 无法使用解决方法:
python3 -m pip install packagename