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/

  • 相关阅读:
    多进程交替控制输出
    最长不重复子串
    const关键字的使用
    C++类的内存分布
    shell编程--awk 、sed 命令介绍
    gcc 6.0编译opencv出错
    NTP同步网络时间
    树莓派配置RTC时钟(DS3231,I2C接口)
    浏览器播放rtmp流
    nginx配置hls
  • 原文地址:https://www.cnblogs.com/wclwcw/p/7727164.html
Copyright © 2011-2022 走看看