• ubuntu server 14.04LTS升级Python3.5


    依次执行如下命令:需要root权限,普通用户可以使用sudo 来执行以下命令

    root@ubuntu-server:~# add-apt-repository ppa:fkrull/deadsnakes

    root@ubuntu-server:~# apt-get update

    root@ubuntu-server:~# apt-get install python3.5     

    root@ubuntu-server:~# python
    Python 2.7.6 (default, Jun 22 2015, 17:58:13)
    [GCC 4.8.2] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    >>> exit()

    这样就安装好了,不过由于环境变量的影响,因此,默认情况下,输入python进入的是python2.7.6,输入python3进入的是python3.4,只有输入python3.5才进入到python3.5。因此我们可以根据需要做以下更改:

    root@ubuntu-server:~# ln -s /usr/bin/python3.5 /usr/bin/python35

    root@ubuntu-server:~# python35
    Python 3.5.3 (default, Apr 22 2017, 00:00:00)
    [GCC 4.8.4] on linux
    Type "help", "copyright", "credits" or "license" for more information.
    >>>

    root@ubuntu-server:~# mv /usr/bin/python3 /usr/bin/python34

    root@ubuntu-server:~# python34
    Python 3.4.3 (default, Oct 14 2015, 20:28:29)
    [GCC 4.8.4] on linux
    Type "help", "copyright", "credits" or "license" for more information.
    >>>

    安装pip

    root@ubuntu-server:~# wget https://bootstrap.pypa.io/get-pip.py

    root@ubuntu-server:~# python35 get-pip.py

    root@ubuntu-server:~# pip3 install setuptools –upgrade

    root@ubuntu-server:~# pip -V
    pip 9.0.1 from /usr/local/lib/python3.5/dist-packages (python 3.5)

    新手小白初学Python,如有错误之处,欢迎指正。

  • 相关阅读:
    python
    HTTP和HTTPS协议,详解
    常用加密算法之非对称加密算法
    Docker容器数据卷-Volume详解
    使用nsenter进入docker容器后端报错 mesg: ttyname failed: No such file or directory
    Docker 查看容器 IP 地址
    Docker容器数据卷volumes-from
    Docker 进入容器的4种方法
    Jmeter之Bean shell使用(二)
    Jmeter之Bean shell使用(一)
  • 原文地址:https://www.cnblogs.com/zd520pyx1314/p/7575507.html
Copyright © 2020-2023  润新知