废话不多说直接搞
1.安装依赖
sudo apt-get install build-essential tk-dev libncurses5-dev libncursesw5-dev libreadline6-dev libdb5.3-dev libgdbm-dev libsqlite3-dev libssl-dev libbz2-dev libexpat1-dev liblzma-dev zlib1g-dev -y
2.安装SSL依赖
sudo apt-get install libssl-dev -y
3.下载并解压python 3.6
wget https://www.python.org/ftp/python/3.6.6/Python-3.6.6.tar.xz
tar xf Python-3.6.6.tar.xz
cd Python-3.6.6
4.编译安装并更新pip
sudo ./configure&&sudo make&&sudo make install
sudo python3.6 -m pip install --upgrade pip
全部命令汇总
sudo apt-get install build-essential tk-dev libncurses5-dev libncursesw5-dev libreadline6-dev libdb5.3-dev libgdbm-dev libsqlite3-dev libssl-dev libbz2-dev libexpat1-dev liblzma-dev zlib1g-dev -y
sudo apt-get install libssl-dev -y
wget https://www.python.org/ftp/python/3.6.6/Python-3.6.6.tar.xz
tar xf Python-3.6.6.tar.xz
cd Python-3.6.6
sudo ./configure&&sudo make&&sudo make install
sudo python3.6 -m pip install --upgrade pip