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 手动模式 自动模式:
自动选择优先级最高的路径为默认路径(数字越大,表示优先级越高)
手动模式:手动选择序号为默认路径

ubuntu python 版本管理的更多相关文章

  1. python版本管理工具pyenv和包管理工具pipenv

    一.pyenv版本管理工具 pyenv是一个python版本管理工具,可以实现轻松切换多个python版本 它可根据每个用户更改全局python版本,也可以为每个项目指定python版本,还可以管理v ...

  2. 使用pyenv对python版本管理

     1.使用pyenv进行python版本管理   1.1安装对应的依赖包,如果不安装后续操作可能会因为缺少某一个变量包而出现错误 sudo apt-get install -y make build- ...

  3. 基于Ubuntu+Python+Tensorflow+Jupyter notebook搭建深度学习环境

    基于Ubuntu+Python+Tensorflow+Jupyter notebook搭建深度学习环境 前言一.环境准备环境介绍软件下载VMware下安装UbuntuUbuntu下Anaconda的安 ...

  4. Ubuntu安装Python版本管理工具pyenv

    gyf@gyf-VirtualBox:~$ git clone https://github.com/yyuu/pyenv.git ~/.pyenvCloning into '/home/gyf/.p ...

  5. Ubuntu python多个版本管理

    1.查看python有哪些版本使用命令 whereis python 如图: 2.这么多版本如何切换呢 使用 sudo update-alternatives --install <link&g ...

  6. ubuntu python的升级与回滚

    转自:https://www.cnblogs.com/wmr95/p/7637077.html 正常情况下,你安装好ubuntu16.04版本之后,系统会自带 python2.7版本,如果需要下载新版 ...

  7. 腾讯云服务器ubuntu16.04系统下安装Python版本管理工具pyenv

    一. 系统环境   腾讯云提供的系统是ubuntu 16.04 LTS,系统默认的Python版本是2.7.12,我想要安装3.6和其他的版本.   比较方便的是腾讯云已经默认安装好了git和curl ...

  8. ubuntu python apache2 wsgi django框架

    在ubuntu上通过apatch2和wsgi部署django (亲手做过!!!) 一,我的python.django.apatch2版本: python:python -V 2.7.3 django: ...

  9. Ubuntu python Compression requires the (missing) zlib module

    描述: 在Ubuntu中安装setuptools时出现   Compression requires the (missing) zlib module 解决方法步骤: ①Ubuntu下安装zlib: ...

随机推荐

  1. source vimrc的时候报错:.vimrc:1: command not found: syntax

    vim的配置如下: 1 syntax enable //语法高亮 2 set number //显示行号 3 set cursorline //突出显示当前行 4 set ruler //打开状态栏标 ...

  2. php中trait的使用方法

    1.php中的trait是啥? 看上去既像类又像接口,其实都不是,Trait可以看做类的部分实现,可以混入一个或多个现有的PHP类中,其作用有两个:表明类可以做什么:提供模块化实现.Trait是一种代 ...

  3. 获取系统相关信息 (CPU使用率 内存使用率 系统磁盘大小)

    引言 在软件开个过程中,对于软件的稳定性和使用率也是我们需要关注的 .  使用sigar来监控,简单方便!  使用说明:下载sigar jar及配合sigar的dll文件来用,需要将dll文件放到JD ...

  4. python 实现自定义切片类

    import numbers class Group: #支持切片操作 def __init__(self, group_name, company_name, staffs): self.group ...

  5. 关于excel中的vlookup就是查找当前列对应的下一列的值的使用

    关于excel中的vlookup就是查找当前列对应的下一列的值的使用 vlookup的使用一些说明 vlookup函数一个4个参数解释下 vlookup(查找的值,表格范围,表格范围中第几列的值,0是 ...

  6. oracle学习笔记(二十三)——JDBC调用存储过程以及批量操作

    jdbc调用存储过程 使用并获得out模式的参数返回值 //存储过程为sum_sal(deptno department.deptno%type,sum in out number) Callable ...

  7. C#函数的参数传递2(ref\out)

    using System; namespace class1 { class program { static void Main(string[] args) { Console.Write(&qu ...

  8. linux tmux用法

    1. 安装工具 Centos : yum install tmux 2. 基本操作 新建会话:tmux new -s session-name 查看会话:tmux ls 进入会话:tmux a -t  ...

  9. django3-视图函数进阶

    1.视图函数的分类 FBV(fucntion base view) CBV(class base view) ,CBV根据定义的方法名 ,判断什么请求执行什么函数 2.FBV转换CBV (不太对劲) ...

  10. CSS @charset规则

    定义和用法 @charset规则指定样式表中使用的字符编码.@charset规则必须在样式表中的第一元素,而不是由任何字符之后进行.在外部样式文件中使用.如果@charset定义了多个规则,则仅使用第 ...