Skip to content

Instantly share code, notes, and snippets.

@SimonLeeGit
Last active September 3, 2021 14:19
Show Gist options
  • Save SimonLeeGit/3a896b8737d78f734b0e1d7fd47a51ce to your computer and use it in GitHub Desktop.
Save SimonLeeGit/3a896b8737d78f734b0e1d7fd47a51ce to your computer and use it in GitHub Desktop.
How to config different python version and switch them
# 切换python的版本
sudo update-alternatives --config python
# 配置使用的python各个版本的链接
# python2
sudo update-alternatives --install /usr/bin/python python /usr/bin/python2.7 1
sudo update-alternatives --install /usr/bin/python python /usr/bin/python2.4 5
# python3
sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.5 5
sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.7 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment