docker 内升级Python 3.5 到3.6

docker 内升级Python 3.5 到3.6

sudo apt-get install software-properties-common
sudo add-apt-repository ppa:jonathonf/python-3.6
sudo apt-get update
sudo apt-get install python3.6

运行命令1,报错

bash: sudo: command not found

解决办法

apt-get update
apt-get install sudo

再次运行命令1,报错

Cannot add PPA: 'ppa:~jonathonf/ubuntu/python-3.6'.

更换命令为

sudo add-apt-repository ppa:deadsnakes/ppa

执行命令3 - 4

sudo apt-get update
sudo apt-get install python3.6
  1. 删除python3.5的pip

    apt-get remove python3-pip
    apt-get autoremove
    
  2. 安装python3.6版本的pip

    apt-get install python3-pip
    rm /usr/bin/python3
    ln -s /usr/bin/python3.6 /usr/bin/python3
    python3.6 -m pip install --upgrade pip
    
  3. 查看python版本

    pip -V
    

你可能感兴趣的:(DeepLearning,Python)