ubuntu18.04 python版本切换
2020-06-02 06:18
330 查看
update-alternatives是ubuntu系统中专门维护系统命令链接符的工具,通过它可以很方便的设置系统默认使用哪个命令、哪个软件版本,比如,我们在系统中同时安装了python2.7和python3.6两个版本,而我们又希望系统默认使用的是python3.6,那怎么办呢?通过update-alternatives就可以很方便的实现了。
1.更新替代列表(管理员权限下)
命令格式:update-alternatives --install 路径1 名称 路径2 版本
路径1 is the symlink pointing to /etc/alternatives/名称.
(e.g. /usr/bin/pager)
名称 is the master name for this link group. (e.g. pager)
路径2 is the location of one of the alternative target files (e.g. /usr/bin/less)
版本 is an integer; options with higher numbers have higher priority in automatic mode.
sudo update-alternatives --install /usr/bin/python python /usr/bin/python2.7 1 sudo update-alternatives --install /usr/bin/python python /usr/bin/python3.6 2
2、查看替代列表:
sudo update-alternatives --list python
3、切换:
sudo update-alternatives --config python
相关文章推荐
- ubuntu切换python的默认版本
- Ubuntu16.04下完美切换Python版本(亲测)
- ubuntu 环境下python2.7和python3.5分别调用不同版本opencv的配置,及opencv的切换
- Ubuntu18.04修改Python默认版本2.7->3.6
- ubuntu中python版本切换
- Ubuntu16.04安装Python3.7及其pip3并切换为默认版本
- ubuntu默认python版本切换(python2与python3)
- ubuntu切换默认Python版本
- 详解Ubuntu16.04安装Python3.7及其pip3并切换为默认版本
- ubuntu下python切换版本
- ubuntu 16.04 python版本切换(python2和python3)
- Ubuntu 16.04 切换Python版本
- ubuntu16.04 切换 python 版本
- 在Ubuntu下切换当前python的版本
- ubuntu python 版本切换
- Ubuntu下python两个版本的切换
- Ubuntu の 多版本Python的安装管理与切换
- Ubuntu18.04中Python2.7与Python3.6的环境切换
- Ubuntu16.04 简单解决多版本python切换以及多版本pip对应问题
- ubuntu python版本切换