2017-09-14 69 views
0

我已經在MAC安裝了OpenSSL(V 10.11.3)蟒蛇(扭曲)在MAC中的openssl安裝給出錯誤?

# brew upgrade 
#brew install openssl 
Warning: openssl 1.0.2l is already installed 

我跑以下命令太;

easy_install PyOpenSSL 

easy_install PyCrypto 

所有這些命令安裝沒有問題。

,並試圖沖泡

#brew link 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 

,但如果我嘗試鏈接OpenSSL的;

brew link /usr/local/opt/openssl/bin --force (or, **lib**, **include** folders) 

我爲所有地點

Error: No available formula with the name "/usr/local/opt/openssl/bin" 

現在,當我嘗試在Python命令提示符下獲得相同的;

>>> from twisted.internet import reactor, endpoints 

我獲得以下錯誤

AttributeError: 'module' object has no attribute 'OP_NO_TLSv1_1' 

完整的錯誤堆棧

File "<stdin>", line 1, in <module> 
    File "/Library/Python/2.7/site-packages/Twisted-17.9.0rc1-py2.7-macosx-10.11-intel.egg/twisted/internet/reactor.py", line 38, in <module> 
    from twisted.internet import default 
    File "/Library/Python/2.7/site-packages/Twisted-17.9.0rc1-py2.7-macosx-10.11-intel.egg/twisted/internet/default.py", line 56, in <module> 
    install = _getInstallFunction(platform) 
    File "/Library/Python/2.7/site-packages/Twisted-17.9.0rc1-py2.7-macosx-10.11-intel.egg/twisted/internet/default.py", line 50, in _getInstallFunction 
    from twisted.internet.selectreactor import install 
    File "/Library/Python/2.7/site-packages/Twisted-17.9.0rc1-py2.7-macosx-10.11-intel.egg/twisted/internet/selectreactor.py", line 18, in <module> 
    from twisted.internet import posixbase 
    File "/Library/Python/2.7/site-packages/Twisted-17.9.0rc1-py2.7-macosx-10.11-intel.egg/twisted/internet/posixbase.py", line 18, in <module> 
    from twisted.internet import error, udp, tcp 
    File "/Library/Python/2.7/site-packages/Twisted-17.9.0rc1-py2.7-macosx-10.11-intel.egg/twisted/internet/tcp.py", line 28, in <module> 
    from twisted.internet._newtls import (
    File "/Library/Python/2.7/site-packages/Twisted-17.9.0rc1-py2.7-macosx-10.11-intel.egg/twisted/internet/_newtls.py", line 21, in <module> 
    from twisted.protocols.tls import TLSMemoryBIOFactory, TLSMemoryBIOProtocol 
    File "/Library/Python/2.7/site-packages/Twisted-17.9.0rc1-py2.7-macosx-10.11-intel.egg/twisted/protocols/tls.py", line 63, in <module> 
    from twisted.internet._sslverify import _setAcceptableProtocols 
    File "/Library/Python/2.7/site-packages/Twisted-17.9.0rc1-py2.7-macosx-10.11-intel.egg/twisted/internet/_sslverify.py", line 38, in <module> 
    TLSVersion.TLSv1_1: SSL.OP_NO_TLSv1_1, 
AttributeError: 'module' object has no attribute 'OP_NO_TLSv1_1' 
>>> 

我怎樣才能解決這個問題?

編輯

如果我嘗試

>>> import OpenSSL 

沒有印刷

但如果我嘗試

>>> import twisted.internet.ssl 

我得到上面提到的問題。

我有以下扭曲的版本安裝;

>>> import twisted 
>>> twisted.__version__ 
'17.9.0rc1' 
>>> 

回答

-1

我已通過安裝最新版本的扭曲

#sudo pip install twisted==13.1.0 
+0

既不是也不是最新版本的扭曲的安裝它的正確方法('須藤PIP克服的問題...' )在任何系統上。 :/ –