Ubuntu16.04自带的python版本为python2.7和python3.5,现在想要安装python3.6.4
代码语言:javascript复制# 官网下载安装包
1. wget http://www.python.org/ftp/python/3.6.4/Python-3.6.4.tgz
# 解压
2. tar -xvzf Python-3.6.4.tgz
# 安装
3. cd Python-3.6.4
4. ./configure --with-ssl
# 编译
5. sudo make
6. sudo make install
# 创建软连接,先查看python3.6.4的安装路径
7. which python3 # /usr/local/bin/python38.mv python python_org ##保留原来的python
9. sudo ln -s /usr/local/bin/python3 python10.pip3 install --upgrade pip ###更新pip311.mv pip pip_org ##保留原来的pip
12. sudo ln -s /usr/local/bin/pip3 pip