If you have tried installing / updating pyOpenSSL to version 0.14 you may have run into an issue when it tries to install the required package cryptography. The specific error I encountered was:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
raise ffiplatform.VerificationError(error) | |
cffi.ffiplatform.VerificationError: importing '/private/tmp/pip_build_root/cryptography/cryptography/hazmat/bindings/__pycache__/_cffi__x5eaa210axf0ae7e21.so': dlopen(/private/tmp/pip_build_root/cryptography/cryptography/hazmat/bindings/__pycache__/_cffi__x5eaa210axf0ae7e21.so, 2): Symbol not found: _CRYPTO_malloc_debug_init | |
Referenced from: /private/tmp/pip_build_root/cryptography/cryptography/hazmat/bindings/__pycache__/_cffi__x5eaa210axf0ae7e21.so | |
Expected in: flat namespace | |
in /private/tmp/pip_build_root/cryptography/cryptography/hazmat/bindings/__pycache__/_cffi__x5eaa210axf0ae7e21.so |
To get around this, you’ll need to set some environment variables before installing cryptography:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# install via MacPorts | |
sudo port install openssl | |
sudo env ARCHFLAGS="-arch x86_64" LDFLAGS="-L/opt/local/lib" CFLAGS="-I/opt/local/include" pip install cryptography | |
# install via Homebrew | |
brew install openssl | |
env ARCHFLAGS="-arch x86_64" LDFLAGS="-L/usr/local/opt/openssl/lib" CFLAGS="-I/usr/local/opt/openssl/include" pip install cryptography |
A pull request has been opened to add this to the documentation but as of this writing it has not yet been merged.