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
随机推荐
- Iterator 使用
Configuration cfg = new Configuration().configure(); SessionFactory factory = cfg.buildSessionFactor ...
- Ubuntu 搭建 LAMP 服务器
/******************************************************************** * Ubuntu 搭建 LAMP 服务器 * 说明: * 想 ...
- DP专题之概率DP
注意:在概率DP中求期望要逆着推,求概率要正着推 概率DP求期望: 链接: http://acm.hdu.edu.cn/showproblem.php?pid=4405 dp[ i ]表示从i点走到n ...
- Tomcat 在Mac OS X中的安装和配置
简单介绍: 1.Tomcat是目前比较流行的Web应用服务器,它是一个轻量级的应用服务器,在中小型系统和并发访问用户不是很多的场合下被普遍使用,是开发和调试JSP程序的首选. 2.Tomcat运行时所 ...
- GIT+Gitolite+Gerrit 环境搭建 ***
系统环境:Ubuntu12.04 服务器上安装git+gitolite+gitweb root@server: 为搭建git服务器终端,假设ID为 192.168.199.117 或域名为: http ...
- bzoj4390
树上差分 感觉挺巧妙的... 每次更新就是在u,v上+1,x是lca(u,v),在x和fa[x]上-1,那么每个点的权值就是子树和,正确性yy一下就行了 不过树状数组的常数真是小,改成前缀和才快了20 ...
- centos 6.2 pptp 客户端 安装(转载)
转自:http://www.lnmpblog.com/archives/611 centos 6.2 64.bit的桌面版本.配置vpn客户端. 步骤: 1.yum -y install pptp 2 ...
- mysql error:You can't specify target table for update in FROM clause
mysql中You can't specify target table for update in FROM clause错误的意思是说,不能先select出同一表中的某些值,再update这个表( ...
- P5107 能量采集
传送门 官方题解 话说最后的答案忘记取模了结果连暴力都挂了可海星-- //minamoto #include<bits/stdc++.h> #define R register #defi ...
- P2093 [国家集训队]JZPFAR(KDTree)
传送门 类似于p4357 不过因为距离相等的时候要优先选择序号小的,所以要重载一下运算符 //minamoto #include<bits/stdc++.h> #define R regi ...