1

所以我正在使用errbot并使用 python3.5 启动了一个 virtualenv。当我运行 errbot 命令时,出现此错误

from OpenSSL import crypto
  File "/Users/me/workspace/chatbotv2/chatbot_venv3/lib/python3.5/site-packages/OpenSSL/__init__.py", line 8, in <module>
    from OpenSSL import rand, crypto, SSL
  File "/Users/me/workspace/chatbotv2/chatbot_venv3/lib/python3.5/site-packages/OpenSSL/rand.py", line 12, in <module>
    from OpenSSL._util import (
  File "/Users/me/workspace/chatbotv2/chatbot_venv3/lib/python3.5/site-packages/OpenSSL/_util.py", line 6, in <module>
    from cryptography.hazmat.bindings.openssl.binding import Binding
  File "/Users/me/workspace/chatbotv2/chatbot_venv3/lib/python3.5/site-packages/cryptography/hazmat/bindings/openssl/binding.py", line 250, in <module>
    _verify_openssl_version(Binding.lib.SSLeay())
  File "/Users/me/workspace/chatbotv2/chatbot_venv3/lib/python3.5/site-packages/cryptography/hazmat/bindings/openssl/binding.py", line 230, in _verify_openssl_version
    "You are linking against OpenSSL 0.9.8, which is no longer "

这是关于 SO 的“问死”话题,所以很明显我很想尽快得到解决方案。我跟着这个答案。但是,当我运行时,brew link --force openssl我得到了这个:

Warning: Refusing to link: openssl
Linking keg-only openssl means you may end up linking against the insecure,
deprecated system OpenSSL while using the headers from Homebrew's openssl.
Instead, pass the full include/library paths to your compiler e.g.:
  -I/usr/local/opt/openssl/include -L/usr/local/opt/openssl/lib

我尝试过:

export CPPFLAGS='-I/usr/local/opt/openssl/include'
export LDFLAGS='-L/usr/local/opt/openssl/lib'

在此之后,我迷路了,不知道该怎么办。当我尝试时:python -c "import ssl; print (ssl.OPENSSL_VERSION)"我仍然得到OpenSSL 0.9.8zg 14 July 2015我在 OSX

4

1 回答 1

1

升级你的点子。pip 8.1+ 将下载一个已预编译密码学的二进制轮。如果您想自己编译,也可以在安装页面的文档中找到正确的 homebrew 环境变量。

于 2016-08-26T17:29:19.570 回答