2015-11-01 12 views
10

Sono nuovo di mac e non capisco perché il mio scrapy non sembra funzionare più. Sospetto che openssl non sia valido nel mio el capitan.Simbolo non trovato: _BIO_new_CMS

ho provato:

pip install cryptography 
pip install pyOpenSSL 
brew install openssl 

e ho ancora ottenere l'errore sotto. C'è qualche modo per sistemarlo?

$ 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 
>>> 
+0

maggiori informazioni qui: https://github.com/pyca/cryptography/issues/2138 – eLRuLL

+0

Cosa versione di pip stai usando? Inoltre, qual è l'output di 'otool -L/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/cryptography/hazmat/bindings/_openssl.so'. Sembra che tu stia installando la crittografia nei tuoi pacchetti Python globali, che di solito è una scelta poco saggia, ma probabilmente non correlata a questo problema. Edit: Dal momento che è/Library è probabile python.org python. Prova a disinstallare la crittografia e poi esegui 'env LDFLAGS =" - L $ (brew --prefix openssl)/lib "CFLAGS =" - I $ (brew --prefix openssl)/include "pip install cryptography' –

+0

@PaulKehrer Grazie, mela python e python.org python forniti sono appena stati mescolati. Dopo aver raddrizzato il percorso della lib, alla fine ha funzionato. – suwopa

risposta

19

ho risolvere questo problema con il seguente comando:

LDFLAGS="-L/usr/local/opt/openssl/lib" pip install cryptography --no-use-wheel 

Fare riferimento alla if homebrew openssl is linked, cryptography builds an unusable wheel

+1

Aggiunta di questo bit LDFLAGS prima che il comando pip mi aiutasse a ottenere scrapy installato su OSX – saturdayplace

+0

hhh anche a me @saturdayplace –

+4

Vale la pena notare che questo comando deve essere eseguito dopo 'pip uninstall cryptography' per eliminare la versione installata in precedenza. –

Problemi correlati