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

    自动模式:
    自动选择优先级最高的路径为默认路径(数字越大,表示优先级越高)
    手动模式:手动选择序号为默认路径
  • 相关阅读:
    POJ题目分类(转)
    ACM训练计划建议(转)
    ACM题集以及各种总结大全(转)
    HDU 2673 (排序)
    HDU 1391 number steps(找规律,数学)
    HDU 1280 前m大的数(排序,字符串)
    HDU 1236 排名(结构体+排序)
    2015 湘潭大学程序设计比赛(Internet)H题-括号匹配
    最短路---hdu2544
    Rescue--hdu1242
  • 原文地址:https://www.cnblogs.com/dinghongkai/p/11073137.html
Copyright © 2011-2022 走看看