sudo update-alternatives --install /usr/bin/python python /usr/bin/python2 100

sudo update-alternatives --install /usr/bin/python python /usr/bin/python3 150

切换时输入

sudo update-alternatives --config python

然后提示输入数字切换到对应的版本

参考文档:

1 https://blog.csdn.net/zhanghenan123/article/details/79288867

ubuntu 16.04 python版本切换(python2和python3)的更多相关文章

  1. Ubuntu 16.04 python和OpenCV安装

    Ubuntu 16.04 python和OpenCV安装:最进在做深度学习和计算机视觉的有关内容,因此要在python中用到opencv.我的电脑装的是Ubuntu 16.04,python 2.7和 ...

  2. ubuntu18.04 python版本切换

    update-alternatives是ubuntu系统中专门维护系统命令链接符的工具,通过它可以很方便的设置系统默认使用哪个命令.哪个软件版本,比如,我们在系统中同时安装了python2.7和pyt ...

  3. Intel realSense ubuntu 16.04+python 环境配置指南

    1. 安装librealsense2-dkms 以及librealsense2-utils 1.Register the server's public key: sudo apt-key adv - ...

  4. 安装Python 3.6 在Ubuntu 16.04 LTS 版本

    Collecting tensorflow Could not find a version that satisfies the requirement tensorflow (from versi ...

  5. ubuntu 16.04 Python Anaconda 安装

    Python Anaconda 不同版本在官网上的位置:https://www.anaconda.com/download/#linux 进入官网=>Changelog=>Product ...

  6. Ubuntu 16.04 server版本开机启动脚本不支持

    Ubuntu16.04开机启动的脚本一直不支持,错误用在将开机启动脚本放到了home/usr/的目录下,应该放到/root才能正常启动.#!/bin/sh -e ## rc.local## This ...

  7. Windows 10+Ubuntu 16.04双系统切换后时间不同步的问题解决

    主要时时区不对造成的,少了8个小时,解决方法: 在Ubuntu的终端下输入以下命令: sudo timedatectl set-local-rtc 1 参考: http://blog.csdn.net ...

  8. 【转】Ubuntu 16.04安装配置TensorFlow GPU版本

    之前摸爬滚打总是各种坑,今天参考这篇文章终于解决了,甚是鸡冻\(≧▽≦)/,电脑不知道怎么的,安装不了16.04,就安装15.10再升级到16.04 requirements: Ubuntu 16.0 ...

  9. windows下Python版本切换使用方法

    由于历史原因,Python有两个大的版本分支,Python2和Python3,又由于一些库只支持某个版本分支,所以需要在电脑上同时安装Python2和Python3,因此如何让两个版本的Python兼 ...

随机推荐

  1. AX_RecordSortedList

    static void RecordSortedList(Args _args) { SalesLine localSalesLine,fetchSalesLine; RecordSortedList ...

  2. 详解js跨域

    什么是跨域? 概念:只要协议.域名.端口有任何一个不同,都被当作是不同的域. 对于端口和协议的不同,只能通过后台来解决.URL 说明 是否允许通信 http://www.a.com/a.js http ...

  3. Springboot & Mybatis 构建restful 服务四

    Springboot & Mybatis 构建restful 服务四 1 前置条件 成功执行完Springboot & Mybatis 构建restful 服务三 2 restful ...

  4. 2019.03.29 NOIP训练 友好国度(点分治+容斥)

    传送门 思路: 直接上点分治+容斥计算每个因数对应的贡献即可. 代码: #include<bits/stdc++.h> #define ri register int using name ...

  5. 利用AnyProxy代理监控APP流量

    1.介绍 AnyProxy 是阿里巴巴基于 Node.js 开发的一款开源代理服务器. 代理服务器站在客户端和服务端的中间,它可以收集双方通信的每个比特.一个完整的代理请求过程为:客户端首先与代理服务 ...

  6. Maven学习笔记5:Maven属性、profile和资源过滤

    Maven的六类属性 内置属性 主要有两个常用内置属性:${basedir}项目的根目录(包含pom.xml文件的目录),${version}项目版本 POM属性 用户可以使用该属性引用POM文件中对 ...

  7. Windows多线程学习随笔

    自学Windows多线程知识,例程如下: #include <iostream> #include <windows.h> #include <process.h> ...

  8. java中super(),与构造方法链(constructor chaining)

    public class Apple extends Fruit { } class Fruit{ public Fruit(String name){ System.out.println(&quo ...

  9. ORACLE 快速刷新物化视图的方法(11g)

    1.on demand:用户需要刷新的时候刷新,这里就要求用户自己动手去刷新数据了(也可以使用job定时刷新) refresh [fast|complete|force] 视图刷新的方式: compl ...

  10. java 调用 api接口

    /* * Copyright 2018 textile.com All right reserved. This software is the * confidential and propriet ...