pip安装加密失败,错误为:M上的命令“cc”失败,退出状态为1

2024-09-30 12:20:13 发布

您现在位置:Python中文网/ 问答频道 /正文

花了将近一个多小时寻找如何在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

在终端控制台的末端。你知道吗


Tags: srcusrerrorbindingscffimethodbiocryptography

热门问题