V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
推荐学习书目
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
271.62D
572.62D
V2EX  ›  Python

修复 pyenv 在 macOS High Sierra 上构建时的 ssl 依赖问题

  •  
  •   Livid ·
    PRO
    · Oct 13, 2017 · 6300 views
    This topic created in 3128 days ago, the information mentioned may be changed or developed.

    macOS 升级到 High Sierra 之后,使用 pyenv 安装新的 Python 版本时可能会遇到这个错误:

    ERROR: The Python ssl extension was not compiled. Missing the OpenSSL lib?
    

    如果系统上已经有 Homebrew,那么可以尝试卸载 openssl 之后再重新安装:

    brew uninstall openssl
    brew install openssl
    

    然后再使用这条指令安装新的 Python 版本:

    CFLAGS="-I$(brew --prefix openssl)/include" LDFLAGS="-L$(brew --prefix openssl)/lib" pyenv install 2.7.14
    
    4 replies    2017-10-13 09:59:10 +08:00
    janxin
        1
    janxin  
       Oct 13, 2017 via iPhone
    不识别新 SDK 的 OpenSSL 库位置,你也可以用 Xcode 自带的 OpenSSL
    syasuker
        2
    syasuker  
       Oct 13, 2017
    貌似 Homebrew 安装 macOS High Sierra 后都会失效,需要重装
    VicYu
        3
    VicYu  
       Oct 13, 2017
    需要给 pyenv 提 issue
    janxin
        4
    janxin  
       Oct 13, 2017
    @syasuker 不会,除非你有段时间没更新了?
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1002 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 55ms · UTC 18:58 · PVG 02:58 · LAX 11:58 · JFK 14:58
    ♥ Do have faith in what you're doing.