zoukankan      html  css  js  c++  java
  • ubuntu 的 python从2.* 升级到3.*

    1、在ubuntu 的终端中用代码下载最新的Python
    sudo apt-get install python3

    2、用命令删除usr/bin/目录下的默认python link文件
    root@salt-master:/usr/bin# ll python*
    lrwxrwxrwx 1 root root 9 Dec 10 2015 python -> python2.7*
    lrwxrwxrwx 1 root root 9 Dec 10 2015 python2 -> python2.7*
    -rwxr-xr-x 1 root root 3546104 Nov 19 2016 python2.7*
    lrwxrwxrwx 1 root root 33 Nov 19 2016 python2.7-config -> x86_64-linux-gnu-python2.7-config*
    lrwxrwxrwx 1 root root 16 Dec 10 2015 python2-config -> python2.7-config*
    lrwxrwxrwx 1 root root 9 Apr 24 17:43 python3 -> python3.5*
    -rwxr-xr-x 2 root root 4460336 Nov 18 2016 python3.5*
    -rwxr-xr-x 2 root root 4460336 Nov 18 2016 python3.5m*
    lrwxrwxrwx 1 root root 10 Apr 24 17:43 python3m -> python3.5m*
    lrwxrwxrwx 1 root root 16 Dec 10 2015 python-config -> python2.7-config*

    删除链接
    lrwxrwxrwx 1 root root 9 Dec 10 2015 python -> python2.7*

    创建链接
    root@salt-master:/usr/bin# ln -s python3.5 python
    查看
    root@salt-master:/usr/bin# ll python*
    lrwxrwxrwx 1 root root 9 Oct 16 09:28 python -> python3.5*
    lrwxrwxrwx 1 root root 9 Dec 10 2015 python2 -> python2.7*
    -rwxr-xr-x 1 root root 3546104 Nov 19 2016 python2.7*
    lrwxrwxrwx 1 root root 33 Nov 19 2016 python2.7-config -> x86_64-linux-gnu-python2.7-config*
    lrwxrwxrwx 1 root root 16 Dec 10 2015 python2-config -> python2.7-config*
    lrwxrwxrwx 1 root root 9 Apr 24 17:43 python3 -> python3.5*
    -rwxr-xr-x 2 root root 4460336 Nov 18 2016 python3.5*
    -rwxr-xr-x 2 root root 4460336 Nov 18 2016 python3.5m*
    lrwxrwxrwx 1 root root 10 Apr 24 17:43 python3m -> python3.5m*
    lrwxrwxrwx 1 root root 16 Dec 10 2015 python-config -> python2.7-config*

    3、执行python -V 会显示版本为3.5.2

    升级成功

    其他:
    pyCharm最新2017激活
    server选项里边输入 http://idea.imsxm.com/

  • 相关阅读:
    Linq 中的Select事例
    C#关于事件的几个好例子
    C#运用实例.读取csv里面的词条,对每一个词条抓取百度百科相关资料,然后存取到数据库
    cookie 和 session 基本使用 以及 封装
    javascript 兼容各个浏览器的事件
    jquery选择器从认识到使用初级篇
    作业八—Alpha阶段项目总结
    第十四次
    第十三次
    十二次
  • 原文地址:https://www.cnblogs.com/wclwcw/p/7727164.html
Copyright © 2011-2022 走看看