suw*_*opa 10 python macos scrapy python-2.7 osx-elcapitan
我是mac的新手,我不明白为什么我的scrapy似乎不再起作用了.我怀疑openssl在我的el capitan中无效.
我试过了:
pip install cryptography
pip install pyOpenSSL
brew install openssl
Run Code Online (Sandbox Code Playgroud)
我仍然得到以下错误.有什么办法可以解决这个问题吗?
$ python
Python 2.7.10 (v2.7.10:15c95b7d81dc, May 23 2015, 09:33:12)
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import OpenSSL
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/OpenSSL/__init__.py", line 8, in <module>
from OpenSSL import rand, crypto, SSL
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/OpenSSL/rand.py", line 11, in <module>
from OpenSSL._util import (
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/OpenSSL/_util.py", line 3, in <module>
from cryptography.hazmat.bindings.openssl.binding import Binding
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/cryptography/hazmat/bindings/openssl/binding.py", line 13, in <module>
from cryptography.hazmat.bindings._openssl import ffi, lib
ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/cryptography/hazmat/bindings/_openssl.so, 2): Symbol not found: _BIO_new_CMS
Referenced from: /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/cryptography/hazmat/bindings/_openssl.so
Expected in: flat namespace
in /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/cryptography/hazmat/bindings/_openssl.so
>>>
Run Code Online (Sandbox Code Playgroud)
sel*_*oot 20
我通过以下命令解决了这个问题:
LDFLAGS="-L/usr/local/opt/openssl/lib" pip install cryptography --no-use-wheel
Run Code Online (Sandbox Code Playgroud)
请参阅如果将homebrew openssl链接,则加密会构建一个无法使用的轮