推荐学习书目
› Learn Python the Hard Way
Python Sites
› PyPI - Python Package Index
› http://diveintopython.org/toc/index.html
› Pocoo
值得关注的项目
› PyPy
› Celery
› Jinja2
› Read the Docs
› gevent
› pyenv
› virtualenv
› Stackless Python
› Beautiful Soup
› 结巴中文分词
› Green Unicorn
› Sentry
› Shovel
› Pyflakes
› pytest
Python 编程
› pep8 Checker
Styles
› PEP 8
› Google Python Style Guide
› Code Style from The Hitchhiker's Guide
Livid
398.39D
556.69D
V2EX  ›  Python

在 Ubuntu 12.04/14.04 LTS 上通过 PPA 安装 Python 2.7 的最新版本

  •  1
     
  •   Livid ·
    PRO
    · Mar 2, 2016 · 3859 views
    This topic created in 3873 days ago, the information mentioned may be changed or developed.

    作为目前在服务器环境中应用最广的 Ubuntu 版本, 12.04 和 14.04 里自带的 Python 2.7 的版本都太旧,尤其是缺乏对 SSL/TLS 的 SNI 功能的支持,在一些和 SSL 有关的应用中会很不方便,而且还会导致 InsecurePlatformWarning 报警。

    可以通过导入下面的这个 PPA 在 Ubuntu LTS 中安装最新版本的 Python 2.7 来解决这个问题。 SNI 支持在 2.7.9 里被 backport 了。

    https://launchpad.net/~fkrull/+archive/ubuntu/deadsnakes-python2.7

    导入步骤:

    sudo add-apt-repository -y ppa:fkrull/deadsnakes-python2.7
    sudo apt-get update
    sudo apt-get install python2.7
    

    然后你就可以在 Ubuntu 12.04/14.04 中用上 Python 2.7.11 了。


    如果你遇到 add-apt-repository: command not found 这个错误,那么请先安装:

    sudo apt-get install -y python-software-properties
    
    1 replies  •  2016-03-02 00:37:54 +08:00
    halfcrazy
        1
    halfcrazy  
       Mar 2, 2016
    感觉用 pyenv 好些,不用变动系统本身的
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   3553 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 04:46 · PVG 12:46 · LAX 21:46 · JFK 00:46
    ♥ Do have faith in what you're doing.