openssl在macOS里面的修复

brew to the rescue:

1
brew install openssl

then brew gives a hint:

Apple has deprecated use of OpenSSL in favor of its own TLS and crypto libraries

Generally there are no consequences of this for you. If you build your
own software and it requires this formula, you’ll need to add to your
build variables:

1
2
3
LDFLAGS: -L/usr/local/opt/openssl/lib
CPPFLAGS: -I/usr/local/opt/openssl/include
PKG_CONFIG_PATH: /usr/local/opt/openssl/lib/pkgconfig

So just export these env vars and rerun your favorite pip install (or better to avoid havoc in future add following to your ~/.bash_profile:

export LDFLAGS=”-L/usr/local/opt/openssl/lib”
export CPPFLAGS=”-I/usr/local/opt/openssl/include”
export PKG_CONFIG_PATH=”/usr/local/opt/openssl/lib/pkgconfig”
This worked for me like a charm!

参考链接

https://github.com/pyca/cryptography/issues/2692