ubuntu18.04 python版本切换
update-alternatives是ubuntu系统中专门维护系统命令链接符的工具,通过它可以很方便的设置系统默认使用哪个命令、哪个软件版本,比如,我们在系统中同时安装了python2.7和python3.6两个版本,而我们又希望系统默认使用的是python3.6,那怎么办呢?通过update-alternatives就可以很方便的实现了。
1.更新替代列表(管理员权限下)
命令格式:update-alternatives --install <link> <name> <path> <priority>
<link> is the symlink pointing to /etc/alternatives/<name>.
(e.g. /usr/bin/pager)
<name> is the master name for this link group.
(e.g. pager)
<path> is the location of one of the alternative target files.
(e.g. /usr/bin/less)
<priority> is an integer; options with higher numbers have higher priority in
automatic mode.
update-alternatives --install /usr/bin/python python /usr/bin/python2.7 1
update-alternatives --install /usr/bin/python python /usr/bin/python3.6 2
2、查看替代列表:
update-alternatives --list python
3、切换:
update-alternatives --config python
ubuntu18.04 python版本切换的更多相关文章
- ubuntu 16.04 python版本切换(python2和python3)
sudo update-alternatives --install /usr/bin/python python /usr/bin/python2 100 sudo update-alternati ...
- Python版本切换和Pip安装
Python版本切换 现在常用的linux系统中都会默认携带python运行环境,在ubuntu 16.04 和centos 7.3中携带有Python 2.7 和Python3.5两个版本, 默认使 ...
- 【转】【Mac系统】之Python版本切换、谷歌浏览器取消自动升级
都是很有用的文章,本文都是转载文章,以便后续查阅: Mac Chrome浏览器取消自动升级(看这一篇就够了) <Mac修改默认python版本> <mac设置python版本切换,和 ...
- 虚拟机Ubuntu18.04——gcc版本的升降
致读者:这是本人第一篇博客,小试牛刀,希望能在以后的道路中分享出更多实用的技巧和知识,大家一起进步. 操作环境: VMware Workstation 14Pro .64位Ubuntu18.04系统 ...
- windows下Python版本切换使用方法
由于历史原因,Python有两个大的版本分支,Python2和Python3,又由于一些库只支持某个版本分支,所以需要在电脑上同时安装Python2和Python3,因此如何让两个版本的Python兼 ...
- ubuntu 下python版本切换
1. 安装ubuuntu 14.04之后python的默认版本为2.7.6但是我想使用python的版本为3.4 可以打开终端:输入:alias python = python3
- Windows Python 版本切换工具 --- Switch Python Version Tool For Windows
2018年1月13日 更新: 如果要用到不同版本的Python 请使用 virtualenv, pip install virtualenv , 我做的这个工具可以拿来维护下环境变量~~ 填好路径自 ...
- ubuntu 默认python版本切换
电脑上面有些脚本是python2的,有些是python3的,但是系统默认是python2,需要设置环境变量来进行切换. python2切换到python3: echo alias python=pyt ...
- linux(ubuntu) python 版本切换
参考链接:https://blog.csdn.net/thankyou0/article/details/79610854
随机推荐
- YTU 2952: A代码填充--谁挡住了我
2952: A代码填充--谁挡住了我 时间限制: 1 Sec 内存限制: 128 MB 提交: 135 解决: 38 题目描述 n个人前后站成一列,对于队列中的任意一个人,如果排在他前面的人的身高 ...
- 演练:使用属性自定义 DataGrid 控件
演练:使用属性自定义 DataGrid 控件 Silverlight 此主题尚未评级 - 评价此主题 Silverlight DataGrid 控件支持常用表格式设置选项,例如交替显示不同的行 ...
- Java用户注册代码
<div class="registerbox"> <sf:form class="form-Register" name="for ...
- [Usaco2015 OPEN] Palindromic Paths
[题目链接] https://www.lydsy.com/JudgeOnline/problem.php?id=4098 [算法] 显然 , 回文路径中第i个字母的位置(x , y)必然满足 : x ...
- bzoj2002 [Hnoi2010]Bounce 弹飞绵羊——分块
题目:https://www.lydsy.com/JudgeOnline/problem.php?id=2002 第一次用分块,感觉超方便啊: 如果记录每个点的弹力系数,那么是O(1)修改O(n)查询 ...
- poj 2411((多米诺骨牌问题))
Mondriaan's Dream Time Limit: 3000MS Memory Limit: 65536K Total Submissions: 12854 Accepted: 748 ...
- hdu 3333(树状数组 + 离线操作)
Turing Tree Time Limit: 6000/3000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total ...
- 【415】C语言文件读写
A program can open and close, and read from, and write to, a file that is defined by the user This i ...
- 11_传智播客iOS视频教程_NS前缀和@符号
NS前缀的有NSLog和NSString Cocoa就是用来开发带界面的应用程序. Foundation框架之中的类.函数绝大多数都是从NextStep来的.看到NS前缀就知道这个类是从哪里来的.是很 ...
- H5的draggable属性和jqueryUI.sortable
拖放 拖放是一种常见的特性,即抓取对象以后拖到另一个位置. 一.HTML5 新特性 在 HTML5 中,拖放是标准的一部分,任何元素都能够拖放. Event On Event Handler 描述 d ...