Skip to content
GitLab
    • GitLab: the DevOps platform
    • Explore GitLab
    • Install GitLab
    • How GitLab compares
    • Get started
    • GitLab docs
    • GitLab Learn
  • Pricing
  • Talk to an expert
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
    • Switch to GitLab Next
    Projects Groups Snippets
  • Sign up now
  • Login
  • Sign in / Register
  • M m2crypto
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 64
    • Issues 64
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 7
    • Merge requests 7
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • m2crypto
  • m2crypto
  • Issues
  • #215
Closed
Open
Issue created May 13, 2018 by adamcho14@adamcho14

pip install M2Crypto --user not working on my Mac

I have macOS Sierra, I have openssl and swig installed and I am trying to install M2Crypto and the following message is displayed:

Collecting M2Crypto
  Using cached https://files.pythonhosted.org/packages/41/50/7d85dc99b1c4f29eca83873d851ec29a8e484a66b31351e62e30be9db7d1/M2Crypto-0.30.1.tar.gz
Requirement already satisfied: typing in ./Library/Python/2.7/lib/python/site-packages (from M2Crypto)
Installing collected packages: M2Crypto
  Running setup.py install for M2Crypto ... error
    Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/b4/1fkn78s94gq8p9qx6g2x5xhc0000gn/T/pip-build-Q1PKZE/M2Crypto/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /var/folders/b4/1fkn78s94gq8p9qx6g2x5xhc0000gn/T/pip-x1CaAl-record/install-record.txt --single-version-externally-managed --compile --user --prefix=:
    running install
    running build
    running build_py
    copying M2Crypto/__init__.py -> build/lib.macosx-10.12-intel-2.7/M2Crypto
    copying M2Crypto/ASN1.py -> build/lib.macosx-10.12-intel-2.7/M2Crypto
    copying M2Crypto/AuthCookie.py -> build/lib.macosx-10.12-intel-2.7/M2Crypto
    copying M2Crypto/BIO.py -> build/lib.macosx-10.12-intel-2.7/M2Crypto
    copying M2Crypto/BN.py -> build/lib.macosx-10.12-intel-2.7/M2Crypto
    copying M2Crypto/callback.py -> build/lib.macosx-10.12-intel-2.7/M2Crypto
    copying M2Crypto/DH.py -> build/lib.macosx-10.12-intel-2.7/M2Crypto
    copying M2Crypto/DSA.py -> build/lib.macosx-10.12-intel-2.7/M2Crypto
    copying M2Crypto/EC.py -> build/lib.macosx-10.12-intel-2.7/M2Crypto
    copying M2Crypto/Engine.py -> build/lib.macosx-10.12-intel-2.7/M2Crypto
    copying M2Crypto/Err.py -> build/lib.macosx-10.12-intel-2.7/M2Crypto
    copying M2Crypto/EVP.py -> build/lib.macosx-10.12-intel-2.7/M2Crypto
    copying M2Crypto/ftpslib.py -> build/lib.macosx-10.12-intel-2.7/M2Crypto
    copying M2Crypto/httpslib.py -> build/lib.macosx-10.12-intel-2.7/M2Crypto
    copying M2Crypto/m2.py -> build/lib.macosx-10.12-intel-2.7/M2Crypto
    copying M2Crypto/m2crypto.py -> build/lib.macosx-10.12-intel-2.7/M2Crypto
    copying M2Crypto/m2urllib.py -> build/lib.macosx-10.12-intel-2.7/M2Crypto
    copying M2Crypto/m2urllib2.py -> build/lib.macosx-10.12-intel-2.7/M2Crypto
    copying M2Crypto/m2xmlrpclib.py -> build/lib.macosx-10.12-intel-2.7/M2Crypto
    copying M2Crypto/Rand.py -> build/lib.macosx-10.12-intel-2.7/M2Crypto
    copying M2Crypto/RC4.py -> build/lib.macosx-10.12-intel-2.7/M2Crypto
    copying M2Crypto/RSA.py -> build/lib.macosx-10.12-intel-2.7/M2Crypto
    copying M2Crypto/six.py -> build/lib.macosx-10.12-intel-2.7/M2Crypto
    copying M2Crypto/SMIME.py -> build/lib.macosx-10.12-intel-2.7/M2Crypto
    copying M2Crypto/threading.py -> build/lib.macosx-10.12-intel-2.7/M2Crypto
    copying M2Crypto/util.py -> build/lib.macosx-10.12-intel-2.7/M2Crypto
    copying M2Crypto/X509.py -> build/lib.macosx-10.12-intel-2.7/M2Crypto
    creating build/lib.macosx-10.12-intel-2.7/M2Crypto/SSL
    copying M2Crypto/SSL/__init__.py -> build/lib.macosx-10.12-intel-2.7/M2Crypto/SSL
    copying M2Crypto/SSL/cb.py -> build/lib.macosx-10.12-intel-2.7/M2Crypto/SSL
    copying M2Crypto/SSL/Checker.py -> build/lib.macosx-10.12-intel-2.7/M2Crypto/SSL
    copying M2Crypto/SSL/Cipher.py -> build/lib.macosx-10.12-intel-2.7/M2Crypto/SSL
    copying M2Crypto/SSL/Connection.py -> build/lib.macosx-10.12-intel-2.7/M2Crypto/SSL
    copying M2Crypto/SSL/Context.py -> build/lib.macosx-10.12-intel-2.7/M2Crypto/SSL
    copying M2Crypto/SSL/Session.py -> build/lib.macosx-10.12-intel-2.7/M2Crypto/SSL
    copying M2Crypto/SSL/ssl_dispatcher.py -> build/lib.macosx-10.12-intel-2.7/M2Crypto/SSL
    copying M2Crypto/SSL/SSLServer.py -> build/lib.macosx-10.12-intel-2.7/M2Crypto/SSL
    copying M2Crypto/SSL/timeout.py -> build/lib.macosx-10.12-intel-2.7/M2Crypto/SSL
    copying M2Crypto/SSL/TwistedProtocolWrapper.py -> build/lib.macosx-10.12-intel-2.7/M2Crypto/SSL
    running build_ext
    building 'M2Crypto._m2crypto' extension
    swigging SWIG/_m2crypto.i to SWIG/_m2crypto_wrap.c
    swig -python -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -I/usr/include/openssl -I/usr/local/include -I/Library/Developer/CommandLineTools/usr/lib/clang/9.0.0/include -I/Library/Developer/CommandLineTools/usr/include -I/usr/include -I/System/Library/Frameworks (framework directory) -I/Library/Frameworks (framework directory) -I/usr/local/include -I/Library/Developer/CommandLineTools/usr/lib/clang/9.0.0/include -I/Library/Developer/CommandLineTools/usr/include -I/usr/include -I/System/Library/Frameworks (framework directory) -I/Library/Frameworks (framework directory) -includeall -modern -builtin -outdir /private/var/folders/b4/1fkn78s94gq8p9qx6g2x5xhc0000gn/T/pip-build-Q1PKZE/M2Crypto/M2Crypto -o SWIG/_m2crypto_wrap.c SWIG/_m2crypto.i
    creating build/temp.macosx-10.12-intel-2.7
    creating build/temp.macosx-10.12-intel-2.7/SWIG
    cc -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -arch i386 -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch x86_64 -arch i386 -pipe -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -I/private/var/folders/b4/1fkn78s94gq8p9qx6g2x5xhc0000gn/T/pip-build-Q1PKZE/M2Crypto/SWIG -c SWIG/_m2crypto_wrap.c -o build/temp.macosx-10.12-intel-2.7/SWIG/_m2crypto_wrap.o -Wno-deprecated-declarations -DTHREADING
    SWIG/_m2crypto_wrap.c:4249:33: warning: implicit conversion loses integer precision: 'size_t' (aka 'unsigned long') to 'int' [-Wshorten-64-to-32]
          void *ret = CRYPTO_malloc(num, file, line);
                      ~~~~~~~~~~~~~ ^~~
    SWIG/_m2crypto_wrap.c:4762:44: warning: implicit conversion loses integer precision: 'size_t' (aka 'unsigned long') to 'int' [-Wshorten-64-to-32]
        ret->num_alloc = sk->num > MIN_NODES ? (size_t)sk->num : MIN_NODES;
                       ~                       ^~~~~~~~~~~~~~~
    SWIG/_m2crypto_wrap.c:4838:19: warning: implicit conversion loses integer precision: 'Py_ssize_t' (aka 'long') to 'int' [-Wshorten-64-to-32]
        *buffer_len = len;
                    ~ ^~~
    SWIG/_m2crypto_wrap.c:4905:12: warning: implicit conversion loses integer precision: 'Py_ssize_t' (aka 'long') to 'int' [-Wshorten-64-to-32]
        *len = len2;
             ~ ^~~~
    SWIG/_m2crypto_wrap.c:5194:12: warning: implicit conversion loses integer precision: 'Py_ssize_t' (aka 'long') to 'int' [-Wshorten-64-to-32]
        return len;
        ~~~~~~ ^~~
    SWIG/_m2crypto_wrap.c:5532:12: warning: implicit conversion loses integer precision: 'size_t' (aka 'unsigned long') to 'int' [-Wshorten-64-to-32]
        return BIO_ctrl_get_write_guarantee(a);
        ~~~~~~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    SWIG/_m2crypto_wrap.c:5583:12: warning: implicit conversion loses integer precision: 'long' to 'int' [-Wshorten-64-to-32]
        return BIO_get_fd(bio, NULL);
        ~~~~~~ ^~~~~~~~~~~~~~~~~~~~~
    /usr/local/include/openssl/bio.h:467:34: note: expanded from macro 'BIO_get_fd'
    # define BIO_get_fd(b,c)         BIO_ctrl(b,BIO_C_GET_FD,0,(char *)c)
                                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    SWIG/_m2crypto_wrap.c:5588:12: warning: implicit conversion loses integer precision: 'long' to 'int' [-Wshorten-64-to-32]
        return BIO_do_handshake(bio);
        ~~~~~~ ^~~~~~~~~~~~~~~~~~~~~
    /usr/local/include/openssl/bio.h:449:34: note: expanded from macro 'BIO_do_handshake'
    # define BIO_do_handshake(b)     BIO_ctrl(b,BIO_C_DO_STATE_MACHINE,0,NULL)
                                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    SWIG/_m2crypto_wrap.c:5680:11: warning: implicit conversion loses integer precision: 'ssize_t' (aka 'long') to 'int' [-Wshorten-64-to-32]
        ret = write(fd, in, inl);
            ~ ^~~~~~~~~~~~~~~~~~
    SWIG/_m2crypto_wrap.c:5698:15: warning: implicit conversion loses integer precision: 'ssize_t' (aka 'long') to 'int' [-Wshorten-64-to-32]
            ret = read(fd, out, outl);
                ~ ^~~~~~~~~~~~~~~~~~~
    SWIG/_m2crypto_wrap.c:5711:9: warning: implicit conversion loses integer precision: 'unsigned long' to 'int' [-Wshorten-64-to-32]
        n = strlen(str);
          ~ ^~~~~~~~~~~
    SWIG/_m2crypto_wrap.c:5733:15: warning: implicit conversion loses integer precision: 'unsigned long' to 'int' [-Wshorten-64-to-32]
            ret = strlen(buf);
                ~ ^~~~~~~~~~~
    SWIG/_m2crypto_wrap.c:6323:9: error: invalid argument type 'void' to unary expression
        if (!HMAC_Init_ex(ctx, kbuf, klen, md, NULL)) {
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    SWIG/_m2crypto_wrap.c:6337:9: error: invalid argument type 'void' to unary expression
        if (!HMAC_Update(ctx, buf, len)) {
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~
    SWIG/_m2crypto_wrap.c:6354:9: error: invalid argument type 'void' to unary expression
        if (!HMAC_Final(ctx, blob, (unsigned int *)&blen)) {
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    SWIG/_m2crypto_wrap.c:6665:13: warning: implicit declaration of function 'EVP_PKEY_base_id' is invalid in C99 [-Wimplicit-function-declaration]
        switch (EVP_PKEY_base_id(pkey)) {
                ^
    SWIG/_m2crypto_wrap.c:6665:13: warning: this function declaration is not a prototype [-Wstrict-prototypes]
    SWIG/_m2crypto_wrap.c:8039:12: warning: implicit conversion loses integer precision: 'long' to 'int' [-Wshorten-64-to-32]
        return BIO_ctrl(bio, BIO_C_SET_SSL, flag, (char *)ssl);
        ~~~~~~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    SWIG/_m2crypto_wrap.c:8098:19: warning: implicit conversion loses integer precision: 'unsigned long' to 'int' [-Wshorten-64-to-32]
                err = ERR_get_error();
                    ~ ^~~~~~~~~~~~~~~
    SWIG/_m2crypto_wrap.c:8154:59: warning: implicit conversion loses integer precision: 'long' to 'int' [-Wshorten-64-to-32]
            ms = ((start->tv_sec + (int)timeout) - tv.tv_sec) * 1000;
               ~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~
    SWIG/_m2crypto_wrap.c:8391:19: warning: implicit conversion loses integer precision: 'unsigned long' to 'int' [-Wshorten-64-to-32]
                err = ERR_get_error();
                    ~ ^~~~~~~~~~~~~~~
    SWIG/_m2crypto_wrap.c:8421:37: warning: implicit conversion loses integer precision: 'Py_ssize_t' (aka 'long') to 'int' [-Wshorten-64-to-32]
        r = SSL_write(ssl, buf.buf, buf.len);
            ~~~~~~~~~               ~~~~^~~
    SWIG/_m2crypto_wrap.c:8464:37: warning: implicit conversion loses integer precision: 'Py_ssize_t' (aka 'long') to 'int' [-Wshorten-64-to-32]
        r = SSL_write(ssl, buf.buf, buf.len);
            ~~~~~~~~~               ~~~~^~~
    SWIG/_m2crypto_wrap.c:8482:19: warning: implicit conversion loses integer precision: 'unsigned long' to 'int' [-Wshorten-64-to-32]
                err = ERR_get_error();
                    ~ ^~~~~~~~~~~~~~~
    SWIG/_m2crypto_wrap.c:8538:12: warning: implicit conversion loses integer precision: 'long' to 'int' [-Wshorten-64-to-32]
        return SSL_CTX_set_session_cache_mode(ctx, mode);
        ~~~~~~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /usr/local/include/openssl/ssl.h:1715:9: note: expanded from macro 'SSL_CTX_set_session_cache_mode'
            SSL_CTX_ctrl(ctx,SSL_CTRL_SET_SESS_CACHE_MODE,m,NULL)
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    SWIG/_m2crypto_wrap.c:8543:12: warning: implicit conversion loses integer precision: 'long' to 'int' [-Wshorten-64-to-32]
        return SSL_CTX_get_session_cache_mode(ctx);
        ~~~~~~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /usr/local/include/openssl/ssl.h:1717:9: note: expanded from macro 'SSL_CTX_get_session_cache_mode'
            SSL_CTX_ctrl(ctx,SSL_CTRL_GET_SESS_CACHE_MODE,0,NULL)
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    SWIG/_m2crypto_wrap.c:8847:5: warning: implicit declaration of function 'X509_STORE_set_verify_cb' is invalid in C99 [-Wimplicit-function-declaration]
        X509_STORE_set_verify_cb(store, x509_store_verify_callback);
        ^
    SWIG/_m2crypto_wrap.c:8847:5: warning: this function declaration is not a prototype [-Wstrict-prototypes]
    SWIG/_m2crypto_wrap.c:9056:14: warning: implicit conversion loses integer precision: 'size_t' (aka 'unsigned long') to 'int' [-Wshorten-64-to-32]
        outlen = BIO_ctrl_pending(bio);
               ~ ^~~~~~~~~~~~~~~~~~~~~
    SWIG/_m2crypto_wrap.c:9084:9: warning: implicit declaration of function 'PKCS7_sign_add_signer' is invalid in C99 [-Wimplicit-function-declaration]
        if (PKCS7_sign_add_signer(p7, x509, pkey, hash, flags) == NULL) {
            ^
    SWIG/_m2crypto_wrap.c:9084:9: warning: this function declaration is not a prototype [-Wstrict-prototypes]
    SWIG/_m2crypto_wrap.c:9084:60: warning: comparison between pointer and integer ('int' and 'void *')
        if (PKCS7_sign_add_signer(p7, x509, pkey, hash, flags) == NULL) {
            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^  ~~~~
    SWIG/_m2crypto_wrap.c:9087:9: warning: implicit declaration of function 'PKCS7_final' is invalid in C99 [-Wimplicit-function-declaration]
        if (PKCS7_final(p7, bio, flags) != 1) {
            ^
    SWIG/_m2crypto_wrap.c:9087:9: warning: this function declaration is not a prototype [-Wstrict-prototypes]
    SWIG/_m2crypto_wrap.c:9127:14: warning: implicit conversion loses integer precision: 'size_t' (aka 'unsigned long') to 'int' [-Wshorten-64-to-32]
        outlen = BIO_ctrl_pending(bio);
               ~ ^~~~~~~~~~~~~~~~~~~~~
    SWIG/_m2crypto_wrap.c:13601:26: warning: implicit declaration of function 'EVP_aes_128_ctr' is invalid in C99 [-Wimplicit-function-declaration]
      result = (EVP_CIPHER *)EVP_aes_128_ctr();
                             ^
    SWIG/_m2crypto_wrap.c:13601:26: warning: this function declaration is not a prototype [-Wstrict-prototypes]
    SWIG/_m2crypto_wrap.c:13601:12: warning: cast to 'EVP_CIPHER *' (aka 'struct evp_cipher_st *') from smaller integer type 'int' [-Wint-to-pointer-cast]
      result = (EVP_CIPHER *)EVP_aes_128_ctr();
               ^
    SWIG/_m2crypto_wrap.c:13666:26: warning: implicit declaration of function 'EVP_aes_192_ctr' is invalid in C99 [-Wimplicit-function-declaration]
      result = (EVP_CIPHER *)EVP_aes_192_ctr();
                             ^
    SWIG/_m2crypto_wrap.c:13666:26: warning: this function declaration is not a prototype [-Wstrict-prototypes]
    SWIG/_m2crypto_wrap.c:13666:12: warning: cast to 'EVP_CIPHER *' (aka 'struct evp_cipher_st *') from smaller integer type 'int' [-Wint-to-pointer-cast]
      result = (EVP_CIPHER *)EVP_aes_192_ctr();
               ^
    SWIG/_m2crypto_wrap.c:13731:26: warning: implicit declaration of function 'EVP_aes_256_ctr' is invalid in C99 [-Wimplicit-function-declaration]
      result = (EVP_CIPHER *)EVP_aes_256_ctr();
                             ^
    SWIG/_m2crypto_wrap.c:13731:26: warning: this function declaration is not a prototype [-Wstrict-prototypes]
    SWIG/_m2crypto_wrap.c:13731:12: warning: cast to 'EVP_CIPHER *' (aka 'struct evp_cipher_st *') from smaller integer type 'int' [-Wint-to-pointer-cast]
      result = (EVP_CIPHER *)EVP_aes_256_ctr();
               ^
    SWIG/_m2crypto_wrap.c:23547:14: warning: implicit conversion loses integer precision: 'Py_ssize_t' (aka 'long') to 'int' [-Wshorten-64-to-32]
          arg4 = len;
               ~ ^~~
    SWIG/_m2crypto_wrap.c:26251:14: warning: implicit conversion loses integer precision: 'Py_ssize_t' (aka 'long') to 'int' [-Wshorten-64-to-32]
          arg3 = len;
               ~ ^~~
    SWIG/_m2crypto_wrap.c:26513:17: warning: implicit declaration of function 'ASN1_TIME_set_string' is invalid in C99 [-Wimplicit-function-declaration]
      result = (int)ASN1_TIME_set_string(arg1,(char const *)arg2);
                    ^
    SWIG/_m2crypto_wrap.c:26513:17: warning: this function declaration is not a prototype [-Wstrict-prototypes]
    45 warnings and 3 errors generated.
    error: command 'cc' failed with exit status 1
    
    ----------------------------------------
Command "/usr/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/b4/1fkn78s94gq8p9qx6g2x5xhc0000gn/T/pip-build-Q1PKZE/M2Crypto/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /var/folders/b4/1fkn78s94gq8p9qx6g2x5xhc0000gn/T/pip-x1CaAl-record/install-record.txt --single-version-externally-managed --compile --user --prefix=" failed with error code 1 in /private/var/folders/b4/1fkn78s94gq8p9qx6g2x5xhc0000gn/T/pip-build-Q1PKZE/M2Crypto/
Edited May 13, 2018 by adamcho14
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking