V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
推荐学习书目
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
V2EX  ›  Python

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

  •  1
     
  •   Livid · 2016-03-02 00:24:26 +08:00 · 3129 次点击
    这是一个创建于 2985 天前的主题,其中的信息可能已经有所发展或是发生改变。

    作为目前在服务器环境中应用最广的 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 条回复    2016-03-02 00:37:54 +08:00
    halfcrazy
        1
    halfcrazy  
       2016-03-02 00:37:54 +08:00
    感觉用 pyenv 好些,不用变动系统本身的
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   937 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 31ms · UTC 23:26 · PVG 07:26 · LAX 16:26 · JFK 19:26
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.