花了将近一个小时的时间来寻找如何在MacOS High Sierra v10.13.3上成功安装cryptography
的解决方案
通过在虚拟环境中使用此命令。
$ pip install cryptography==0.9
我得到了这么长的错误集:
src/cryptography/hazmat/bindings/__pycache__/_Cryptography_cffi_e7d09016xc302a38b.c:505:6: error: conflicting types for 'BIO_new_mem_buf'
BIO *BIO_new_mem_buf(void *, int);
^
/usr/local/opt/openssl/include/openssl/bio.h:692:6: note: previous declaration is here
BIO *BIO_new_mem_buf(const void *buf, int len);
^
src/cryptography/hazmat/bindings/__pycache__/_Cryptography_cffi_e7d09016xc302a38b.c:2019:15: error: redefinition of 'SSLv2_method' as different kind of symbol
SSL_METHOD* (*SSLv2_method)(void) = NULL;
^
/usr/local/opt/openssl/include/openssl/ssl.h:2349:19: note: previous definition is here
const SSL_METHOD *SSLv2_method(void); /* SSLv2 */
^
src/cryptography/hazmat/bindings/__pycache__/_Cryptography_cffi_e7d09016xc302a38b.c:2020:15: error: redefinition of 'SSLv2_client_method' as different kind of symbol
SSL_METHOD* (*SSLv2_client_method)(void) = NULL;
^
/usr/local/opt/openssl/include/openssl/ssl.h:2351:19: note: previous definition is here
const SSL_METHOD *SSLv2_client_method(void); /* SSLv2 */
^
src/cryptography/hazmat/bindings/__pycache__/_Cryptography_cffi_e7d09016xc302a38b.c:2021:15: error: redefinition of 'SSLv2_server_method' as different kind of symbol
SSL_METHOD* (*SSLv2_server_method)(void) = NULL;
^
/usr/local/opt/openssl/include/openssl/ssl.h:2350:19: note: previous definition is here
const SSL_METHOD *SSLv2_server_method(void); /* SSLv2 */
^
src/cryptography/hazmat/bindings/__pycache__/_Cryptography_cffi_e7d09016xc302a38b.c:17971:29: warning: implicit conversion loses integer precision: 'long' to 'int' [-Wshorten-64-to-32]
{ result = BIO_set_fd(x0, x1, x2); }
~~~~~~~~~~~~~~~^~~~~~~
/usr/local/opt/openssl/include/openssl/bio.h:520:64: note: expanded from macro 'BIO_set_fd'
# define BIO_set_fd(b,fd,c) BIO_int_ctrl(b,BIO_C_SET_FD,c,fd)
~~~~~~~~~~~~ ^~
src/cryptography/hazmat/bindings/__pycache__/_Cryptography_cffi_e7d09016xc302a38b.c:45897:14: warning: implicit conversion loses integer precision: 'long' to 'int' [-Wshorten-64-to-32]
{ result = X509_CRL_get_version(x0); }
~ ^~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/opt/openssl/include/openssl/x509.h:602:42: note: expanded from macro 'X509_CRL_get_version'
# define X509_CRL_get_version(x) ASN1_INTEGER_get((x)->crl->version)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2 warnings and 4 errors generated.
error: command 'cc' failed with exit status 1
我还通过使用brew在该GitHub source上尝试了以下说明,给出命令brew install openssl
,然后在~/.bash_profile
上进行了更改。
不幸的是,错误仍然存在,但我仍然得到这个
2 warnings and 4 errors generated.
error: command 'cc' failed with exit status 1
在终端控制台的结尾。