zoukankan      html  css  js  c++  java
  • ubuntu python 版本管理

    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         手动模式

    自动模式:
    自动选择优先级最高的路径为默认路径(数字越大,表示优先级越高)
    手动模式:手动选择序号为默认路径
  • 相关阅读:
    【转】SMARTY 不乱码截取中文
    godaddy最新优惠码
    javascript 学习之屏幕尺寸获取。
    IE6 实现minwidth
    css 修改页面选中时背景颜色
    jQuery 闪动的文字提示
    jQuery插件 blockUI
    HTML 5 video 视频标签全属性详解
    linux打包压缩命令汇总
    Windows 下MySQL zip 安装
  • 原文地址:https://www.cnblogs.com/dinghongkai/p/11073137.html
Copyright © 2011-2022 走看看