OS X上的Python和OpenSSL版本参考问题 [英] Python and OpenSSL version reference issue on OS X

查看:210
本文介绍了OS X上的Python和OpenSSL版本参考问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尝试解决我遇到的OpenSSL版本问题.

Trying to resolve an OpenSSL version issue I'm having.

似乎我的Mac上有三个不同版本的OpenSSL.

It seems that I have three different versions of OpenSSL on my Mac.

  1. Python 2.7.11的版本为0.9.7m:

  1. Python 2.7.11 has version 0.9.7m:

python -c "import ssl; print ssl.OPENSSL_VERSION"
OpenSSL 0.9.7m 23 Feb 2007

  • 在航站楼:

  • At the Terminal:

    openssl version
    OpenSSL 1.0.1h 5 Jun 2014
    

  • 最近已编译/安装:

  • Recently Compiled / Installed:

    /usr/local/ssl/bin/openssl
    OpenSSL> version
    OpenSSL 1.0.2h  3 May 2016
    OpenSSL>
    

  • 我最近将OS X升级到了10.11.5.在此过程中,导致以前使用的python脚本出现问题.下面是错误消息摘录:

    I recently upgraded my OS X to 10.11.5. In the process, caused an issue for previously working python scripts. Below is the error message snippet:

    Python错误消息:

    Python Error Message:

     You are linking against OpenSSL 0.9.8, which is no longer *
     RuntimeError: You are linking against OpenSSL 0.9.8, which is no longer support by the OpenSSL project. You need to upgrade to a newer version of OpenSSL.
    

    (*-是的,这是错误消息的样子.在句子的中间进行了修剪.)

    (* - yes, this is how the error message looks like. It's trimmed in the middle of the sentence.)

    任何解决此问题的建议将不胜感激.我想让Python引用OpenSSL版本1.0.2h和过时的版本0.9.7m.

    Any recommendations on resolving this issue would be greatly appreciated. What I'd like is to have Python reference the OpenSSL version 1.0.2h vs the outdated version 0.9.7m.

    我尝试使用各种帖子/博客多次安装Python和OpenSSL,但没有任何运气.

    I've tried installing Python and OpenSSL many times using various post / blogs for guidance without any luck.

    推荐答案

    您可以安装使用更新版本的openssl的python版本.

    You can install a version of python that uses a newer version of openssl.

    首先,您可以酝酿安装新版本的开放SSL

    First you can brew install a new version of open SSL

    brew update
    brew install openssl
    brew link --force openssl
    

    您应该会看到带有的新版本

    You should see a newer version with

    openssl version -a
    

    然后,您可以安装使用该新版本的openssl的其他版本的python.如果您使用 pyenv ,则应为:

    Then you can install a different version of python which uses that newer version of openssl. If you use pyenv, that would be:

    CFLAGS="-I$(brew --prefix openssl)/include" \
    LDFLAGS="-L$(brew --prefix openssl)/lib" \
    pyenv install -v 3.4.3
    

    您可以在此处找到有关使用openssl的现成安装版本安装python版本的更多信息: https://github.com/yyuu/pyenv/wiki/Common-build-problems

    You can find more information about installing a version of python with a brew installed version of openssl here: https://github.com/yyuu/pyenv/wiki/Common-build-problems

    这篇关于OS X上的Python和OpenSSL版本参考问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

    查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆