docker内更换python及pip到3.8

python更新版本

  1. apt-get update (更新)
  2. sudo apt install python3.8 python3.8-dev -y(安装python3.8)
  3. ls -l /usr/bin | grep python (查看默认python指向)
  4. rm /usr/bin/python(删除原有python软连接)
  5. ln -s /usr/bin/python3.8 /usr/bin/python(建立python到python3.8新的软链接)

更新pip

  1. apt-get install -y python3-pip(安装python3.8版本的pip)
  2. python3.8 -m pip install --upgrade pip

检查版本

python -V
pip -V

你可能感兴趣的:(docker,python,pip)