ubuntu python 版本管理
2024-09-11 04:56:17
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 手动模式 自动模式:自动选择优先级最高的路径为默认路径(
数字越大,表示优先级越高)
手动模式:手动选择序号为默认路径
最新文章
- Visual Studio问题集锦:coloader80.dll未正确安装
- 我的CentOS 7 U盘安装之路 (Win 8.1 Profession + CentOS 7双系统)
- 关于Java加载属性文件放在web容器不好使的解决办法
- iOS企业版打包(转载)
- redis使用
- PHP 魔术方法(所有的魔术方法)
- strip, 关于去除目标文件种的不必要信息
- 查看当前hadoop的版本号
- 关于memcpy和memmove的一点说明
- apache配置重写
- B树、B-树、B+树、B*树都是什么(转)
- 信号量多-threaded同步Semaphore
- CoreCRM 开发实录 —— 单元测试之 Mock UserManager 和 SignInManager
- NIagara Workbench ( 温度控制)
- sql server 索引阐述系列三 表的堆组织
- inception v1-v3 &; Xception
- 1121 Damn Single (25 分)
- php箭头符号
- 2049. [SDOI2008]Cave 洞穴勘测【LCT】
- mac下安装mysql 1820 重置默认密码
热门文章
- Loj #6503. 「雅礼集训 2018 Day4」Magic
- CentOs安装mysql数据库
- IT兄弟连 HTML5教程 HTML文件的主体结构
- struts2文件上传报错
- Solr java.sql.SQLException: null, message from server: ";Host &#39;xxx&#39; is not allowed to connect to this MySQL server
- Django之Django快速体验
- 通过对象方法获取委托_C#反射获取委托_
- Rpg maker mv角色扮演游戏制作大师简介
- springBoot 集成Mysql数据库
- 易优CMS:小白学代码之notempty