ubuntu 命令行查看 python 目录

$ whereis python # 显示所有得到 python 目录

$ which python  # 显示默认的 python 解释器目录

$ which python3.7  # 显示 python3.7 版本的解释器目录

update-alternatives 版本管理

$ update-alternatives --help 查看所有的命令和参数,常用的命令有:

  • update-alternatives --install  <link>  <name>  <path>  :add a group of a alternatives to the system
  • update-alternatives --config  <name> :show alternatives for the <name> group and ask the user to select which one to use
  • update-alternatives --remove <name> <path> :remove <path> from the <name> group alternatives

$ update-alternatives --list python

出现错误 update-alternatives: error: no alternatives for python,首先需要创建 python 组,增加可选项,如:

$ update-alternatives --install /usr/bin/python python /usr/bin/python2.7

$ update-alternatives  --install /usr/bin/python python /usr/bin/python3.5

$ update-alternatives  --config python

  选择                 路径           优先级        状态
------------------------------------------------------------
* 0 /usr/bin/python2.7 2 自动模式
1 /usr/bin/python2.7 2 手动模式
2 /usr/bin/python3.5 1 手动模式 自动模式:
自动选择优先级最高的路径为默认路径(数字越大,表示优先级越高)
手动模式:手动选择序号为默认路径

最新文章

  1. Visual Studio问题集锦:coloader80.dll未正确安装
  2. 我的CentOS 7 U盘安装之路 (Win 8.1 Profession + CentOS 7双系统)
  3. 关于Java加载属性文件放在web容器不好使的解决办法
  4. iOS企业版打包(转载)
  5. redis使用
  6. PHP 魔术方法(所有的魔术方法)
  7. strip, 关于去除目标文件种的不必要信息
  8. 查看当前hadoop的版本号
  9. 关于memcpy和memmove的一点说明
  10. apache配置重写
  11. B树、B-树、B+树、B*树都是什么(转)
  12. 信号量多-threaded同步Semaphore
  13. CoreCRM 开发实录 —— 单元测试之 Mock UserManager 和 SignInManager
  14. NIagara Workbench ( 温度控制)
  15. sql server 索引阐述系列三 表的堆组织
  16. inception v1-v3 &amp; Xception
  17. 1121 Damn Single (25 分)
  18. php箭头符号
  19. 2049. [SDOI2008]Cave 洞穴勘测【LCT】
  20. mac下安装mysql 1820 重置默认密码

热门文章

  1. Loj #6503. 「雅礼集训 2018 Day4」Magic
  2. CentOs安装mysql数据库
  3. IT兄弟连 HTML5教程 HTML文件的主体结构
  4. struts2文件上传报错
  5. Solr java.sql.SQLException: null, message from server: &quot;Host &#39;xxx&#39; is not allowed to connect to this MySQL server
  6. Django之Django快速体验
  7. 通过对象方法获取委托_C#反射获取委托_
  8. Rpg maker mv角色扮演游戏制作大师简介
  9. springBoot 集成Mysql数据库
  10. 易优CMS:小白学代码之notempty