代码之家  ›  专栏  ›  技术社区  ›  Shift 'n Tab

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

  •  0
  • Shift 'n Tab  · 技术社区  · 7 年前

    花了将近一个多小时寻找如何成功安装的解决方案 cryptography 在MacOS High Sierra v10上。13.3

    在虚拟环境下使用此命令。

    $ 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
    

    我还在这个GitHub上尝试了以下指令 source 通过使用brew,发出以下命令 brew install openssl ,然后在上进行更改 ~/.bash_profile .

    2 warnings and 4 errors generated.
    error: command 'cc' failed with exit status 1
    

    在终端控制台的末端。

    0 回复  |  直到 7 年前