Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Building Wheel For Pycares (Setup.Py) Error

This is my first time ever posting to Stack Overflow, so my apologies for any inadvertent cringe.

I'm attempting to install twint on a Macbook Pro (late 2013) running macOS Mojave version 10.14.6.

When I run the command:

pip3 install twint==2.1.4 fire tqdm

Everything seems to work fine ... until my machine gets to the pycares part of things.

At that point, I receive this incredibly long error message:

  Building wheel for pycares (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: /usr/local/opt/[email protected]/bin/python3.9 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/xn/8s6c14ws39v8x7gn13dpjj680000gp/T/pip-install-rsphcstm/pycares_e62e234778824ea1834667778e68b769/setup.py'"'"'; __file__='"'"'/private/var/folders/xn/8s6c14ws39v8x7gn13dpjj680000gp/T/pip-install-rsphcstm/pycares_e62e234778824ea1834667778e68b769/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /private/var/folders/xn/8s6c14ws39v8x7gn13dpjj680000gp/T/pip-wheel-nw_89tid
       cwd: /private/var/folders/xn/8s6c14ws39v8x7gn13dpjj680000gp/T/pip-install-rsphcstm/pycares_e62e234778824ea1834667778e68b769/
  Complete output (105 lines):
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.macosx-10.14-x86_64-3.9
  creating build/lib.macosx-10.14-x86_64-3.9/pycares
  copying src/pycares/errno.py -> build/lib.macosx-10.14-x86_64-3.9/pycares
  copying src/pycares/_version.py -> build/lib.macosx-10.14-x86_64-3.9/pycares
  copying src/pycares/__init__.py -> build/lib.macosx-10.14-x86_64-3.9/pycares
  copying src/pycares/utils.py -> build/lib.macosx-10.14-x86_64-3.9/pycares
  copying src/pycares/__main__.py -> build/lib.macosx-10.14-x86_64-3.9/pycares
  running build_ext
  generating cffi module 'build/temp.macosx-10.14-x86_64-3.9/_cares.c'
  creating build/temp.macosx-10.14-x86_64-3.9
  building '_cares' extension
  creating build/temp.macosx-10.14-x86_64-3.9/build
  creating build/temp.macosx-10.14-x86_64-3.9/build/temp.macosx-10.14-x86_64-3.9
  creating build/temp.macosx-10.14-x86_64-3.9/deps
  creating build/temp.macosx-10.14-x86_64-3.9/deps/c-ares
  creating build/temp.macosx-10.14-x86_64-3.9/deps/c-ares/src
  clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk -I/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers -DHAVE_CONFIG_H=1 -D_LARGEFILE_SOURCE=1 -D_FILE_OFFSET_BITS=64 -D_DARWIN_USE_64_BIT_INODE=1 -I/usr/local/include -I/usr/local/opt/[email protected]/include -I/usr/local/opt/sqlite/include -I/usr/local/Cellar/[email protected]/3.9.0_4/Frameworks/Python.framework/Versions/3.9/include/python3.9 -Ideps/c-ares/src -Ideps/c-ares/src/config_darwin -c build/temp.macosx-10.14-x86_64-3.9/_cares.c -o build/temp.macosx-10.14-x86_64-3.9/build/temp.macosx-10.14-x86_64-3.9/_cares.o
  build/temp.macosx-10.14-x86_64-3.9/_cares.c:2682:55: error: too many arguments to function call, expected 6, have 7
    return ares_parse_ptr_reply(x0, x1, x2, x3, x4, x5, x6);
           ~~~~~~~~~~~~~~~~~~~~                         ^~
  /usr/local/include/ares.h:653:14: note: 'ares_parse_ptr_reply' declared here
  CARES_EXTERN int ares_parse_ptr_reply(const unsigned char *abuf,
               ^
  build/temp.macosx-10.14-x86_64-3.9/_cares.c:2760:59: error: too many arguments to function call, expected 6, have 7
    { result = ares_parse_ptr_reply(x0, x1, x2, x3, x4, x5, x6); }
               ~~~~~~~~~~~~~~~~~~~~                         ^~
  /usr/local/include/ares.h:653:14: note: 'ares_parse_ptr_reply' declared here
  CARES_EXTERN int ares_parse_ptr_reply(const unsigned char *abuf,
               ^
  build/temp.macosx-10.14-x86_64-3.9/_cares.c:4403:14: error: no member named 'ttl' in 'struct ares_mx_reply'
    (void)((p->ttl) | 0);  /* check that 'struct ares_mx_reply.ttl' is an integer */
            ~  ^
  build/temp.macosx-10.14-x86_64-3.9/_cares.c:4419:14: error: no member named 'ttl' in 'struct ares_naptr_reply'
    (void)((p->ttl) | 0);  /* check that 'struct ares_naptr_reply.ttl' is an integer */
            ~  ^
  build/temp.macosx-10.14-x86_64-3.9/_cares.c:4459:14: error: no member named 'ttl' in 'struct ares_soa_reply'
    (void)((p->ttl) | 0);  /* check that 'struct ares_soa_reply.ttl' is an integer */
            ~  ^
  build/temp.macosx-10.14-x86_64-3.9/_cares.c:4473:14: error: no member named 'ttl' in 'struct ares_srv_reply'
    (void)((p->ttl) | 0);  /* check that 'struct ares_srv_reply.ttl' is an integer */
            ~  ^
  build/temp.macosx-10.14-x86_64-3.9/_cares.c:4486:14: error: no member named 'ttl' in 'struct ares_txt_ext'
    (void)((p->ttl) | 0);  /* check that 'struct ares_txt_ext.ttl' is an integer */
            ~  ^
  build/temp.macosx-10.14-x86_64-3.9/_cares.c:4498:14: error: no member named 'ttl' in 'struct ares_txt_reply'
    (void)((p->ttl) | 0);  /* check that 'struct ares_txt_reply.ttl' is an integer */
            ~  ^
  build/temp.macosx-10.14-x86_64-3.9/_cares.c:4757:12: error: no member named 'ttl' in 'ares_mx_reply'
    { "ttl", offsetof(struct ares_mx_reply, ttl),
             ^                              ~~~
  /Library/Developer/CommandLineTools/usr/lib/clang/10.0.1/include/stddef.h:120:24: note: expanded from macro 'offsetof'
  #define offsetof(t, d) __builtin_offsetof(t, d)
                         ^                     ~
  build/temp.macosx-10.14-x86_64-3.9/_cares.c:4758:48: error: no member named 'ttl' in 'struct ares_mx_reply'
             sizeof(((struct ares_mx_reply *)0)->ttl),
                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~  ^
  build/temp.macosx-10.14-x86_64-3.9/_cares.c:4781:12: error: no member named 'ttl' in 'ares_naptr_reply'
    { "ttl", offsetof(struct ares_naptr_reply, ttl),
             ^                                 ~~~
  /Library/Developer/CommandLineTools/usr/lib/clang/10.0.1/include/stddef.h:120:24: note: expanded from macro 'offsetof'
  #define offsetof(t, d) __builtin_offsetof(t, d)
                         ^                     ~
  build/temp.macosx-10.14-x86_64-3.9/_cares.c:4782:51: error: no member named 'ttl' in 'struct ares_naptr_reply'
             sizeof(((struct ares_naptr_reply *)0)->ttl),
                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  ^
  build/temp.macosx-10.14-x86_64-3.9/_cares.c:4853:12: error: no member named 'ttl' in 'ares_soa_reply'
    { "ttl", offsetof(struct ares_soa_reply, ttl),
             ^                               ~~~
  /Library/Developer/CommandLineTools/usr/lib/clang/10.0.1/include/stddef.h:120:24: note: expanded from macro 'offsetof'
  #define offsetof(t, d) __builtin_offsetof(t, d)
                         ^                     ~
  build/temp.macosx-10.14-x86_64-3.9/_cares.c:4854:49: error: no member named 'ttl' in 'struct ares_soa_reply'
             sizeof(((struct ares_soa_reply *)0)->ttl),
                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~  ^
  build/temp.macosx-10.14-x86_64-3.9/_cares.c:4871:12: error: no member named 'ttl' in 'ares_srv_reply'
    { "ttl", offsetof(struct ares_srv_reply, ttl),
             ^                               ~~~
  /Library/Developer/CommandLineTools/usr/lib/clang/10.0.1/include/stddef.h:120:24: note: expanded from macro 'offsetof'
  #define offsetof(t, d) __builtin_offsetof(t, d)
                         ^                     ~
  build/temp.macosx-10.14-x86_64-3.9/_cares.c:4872:49: error: no member named 'ttl' in 'struct ares_srv_reply'
             sizeof(((struct ares_srv_reply *)0)->ttl),
                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~  ^
  build/temp.macosx-10.14-x86_64-3.9/_cares.c:4886:12: error: no member named 'ttl' in 'ares_txt_ext'
    { "ttl", offsetof(struct ares_txt_ext, ttl),
             ^                             ~~~
  /Library/Developer/CommandLineTools/usr/lib/clang/10.0.1/include/stddef.h:120:24: note: expanded from macro 'offsetof'
  #define offsetof(t, d) __builtin_offsetof(t, d)
                         ^                     ~
  build/temp.macosx-10.14-x86_64-3.9/_cares.c:4887:47: error: no member named 'ttl' in 'struct ares_txt_ext'
             sizeof(((struct ares_txt_ext *)0)->ttl),
                    ~~~~~~~~~~~~~~~~~~~~~~~~~~  ^
  build/temp.macosx-10.14-x86_64-3.9/_cares.c:4898:12: error: no member named 'ttl' in 'ares_txt_reply'
    { "ttl", offsetof(struct ares_txt_reply, ttl),
             ^                               ~~~
  /Library/Developer/CommandLineTools/usr/lib/clang/10.0.1/include/stddef.h:120:24: note: expanded from macro 'offsetof'
  #define offsetof(t, d) __builtin_offsetof(t, d)
                         ^                     ~
  fatal error: too many errors emitted, stopping now [-ferror-limit=]
  20 errors generated.
  error: command '/usr/bin/clang' failed with exit code 1
  ----------------------------------------
  ERROR: Failed building wheel for pycares
  Running setup.py clean for pycares
  Building wheel for termcolor (setup.py) ... done
  Created wheel for termcolor: filename=termcolor-1.1.0-py3-none-any.whl size=4829 sha256=c214e388921652325c2a3983e146fa540a22afda156e29172146ba1afa1867b6
  Stored in directory: /Users/oldmacbook/Library/Caches/pip/wheels/b6/0d/90/0d1bbd99855f99cb2f6c2e5ff96f8023fad8ec367695f7d72d
Successfully built twint termcolor
Failed to build pycares
Installing collected packages: pycares, numpy, geographiclib, aiohttp, termcolor, schedule, pysocks, pandas, geopy, fake-useragent, elasticsearch, cchardet, beautifulsoup4, aiohttp-socks, aiodns, twint, tqdm, fire
    Running setup.py install for pycares ... error
    ERROR: Command errored out with exit status 1:
     command: /usr/local/opt/[email protected]/bin/python3.9 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/xn/8s6c14ws39v8x7gn13dpjj680000gp/T/pip-install-rsphcstm/pycares_e62e234778824ea1834667778e68b769/setup.py'"'"'; __file__='"'"'/private/var/folders/xn/8s6c14ws39v8x7gn13dpjj680000gp/T/pip-install-rsphcstm/pycares_e62e234778824ea1834667778e68b769/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/xn/8s6c14ws39v8x7gn13dpjj680000gp/T/pip-record-zthgkaej/install-record.txt --single-version-externally-managed --compile --install-headers /usr/local/include/python3.9/pycares
         cwd: /private/var/folders/xn/8s6c14ws39v8x7gn13dpjj680000gp/T/pip-install-rsphcstm/pycares_e62e234778824ea1834667778e68b769/
    Complete output (105 lines):
    running install
    running build
    running build_py
    creating build
    creating build/lib.macosx-10.14-x86_64-3.9
    creating build/lib.macosx-10.14-x86_64-3.9/pycares
    copying src/pycares/errno.py -> build/lib.macosx-10.14-x86_64-3.9/pycares
    copying src/pycares/_version.py -> build/lib.macosx-10.14-x86_64-3.9/pycares
    copying src/pycares/__init__.py -> build/lib.macosx-10.14-x86_64-3.9/pycares
    copying src/pycares/utils.py -> build/lib.macosx-10.14-x86_64-3.9/pycares
    copying src/pycares/__main__.py -> build/lib.macosx-10.14-x86_64-3.9/pycares
    running build_ext
    generating cffi module 'build/temp.macosx-10.14-x86_64-3.9/_cares.c'
    creating build/temp.macosx-10.14-x86_64-3.9
    building '_cares' extension
    creating build/temp.macosx-10.14-x86_64-3.9/build
    creating build/temp.macosx-10.14-x86_64-3.9/build/temp.macosx-10.14-x86_64-3.9
    creating build/temp.macosx-10.14-x86_64-3.9/deps
    creating build/temp.macosx-10.14-x86_64-3.9/deps/c-ares
    creating build/temp.macosx-10.14-x86_64-3.9/deps/c-ares/src
    clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk -I/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers -DHAVE_CONFIG_H=1 -D_LARGEFILE_SOURCE=1 -D_FILE_OFFSET_BITS=64 -D_DARWIN_USE_64_BIT_INODE=1 -I/usr/local/include -I/usr/local/opt/[email protected]/include -I/usr/local/opt/sqlite/include -I/usr/local/Cellar/[email protected]/3.9.0_4/Frameworks/Python.framework/Versions/3.9/include/python3.9 -Ideps/c-ares/src -Ideps/c-ares/src/config_darwin -c build/temp.macosx-10.14-x86_64-3.9/_cares.c -o build/temp.macosx-10.14-x86_64-3.9/build/temp.macosx-10.14-x86_64-3.9/_cares.o
    build/temp.macosx-10.14-x86_64-3.9/_cares.c:2682:55: error: too many arguments to function call, expected 6, have 7
      return ares_parse_ptr_reply(x0, x1, x2, x3, x4, x5, x6);
             ~~~~~~~~~~~~~~~~~~~~                         ^~
    /usr/local/include/ares.h:653:14: note: 'ares_parse_ptr_reply' declared here
    CARES_EXTERN int ares_parse_ptr_reply(const unsigned char *abuf,
                 ^
    build/temp.macosx-10.14-x86_64-3.9/_cares.c:2760:59: error: too many arguments to function call, expected 6, have 7
      { result = ares_parse_ptr_reply(x0, x1, x2, x3, x4, x5, x6); }
                 ~~~~~~~~~~~~~~~~~~~~                         ^~
    /usr/local/include/ares.h:653:14: note: 'ares_parse_ptr_reply' declared here
    CARES_EXTERN int ares_parse_ptr_reply(const unsigned char *abuf,
                 ^
    build/temp.macosx-10.14-x86_64-3.9/_cares.c:4403:14: error: no member named 'ttl' in 'struct ares_mx_reply'
      (void)((p->ttl) | 0);  /* check that 'struct ares_mx_reply.ttl' is an integer */
              ~  ^
    build/temp.macosx-10.14-x86_64-3.9/_cares.c:4419:14: error: no member named 'ttl' in 'struct ares_naptr_reply'
      (void)((p->ttl) | 0);  /* check that 'struct ares_naptr_reply.ttl' is an integer */
              ~  ^
    build/temp.macosx-10.14-x86_64-3.9/_cares.c:4459:14: error: no member named 'ttl' in 'struct ares_soa_reply'
      (void)((p->ttl) | 0);  /* check that 'struct ares_soa_reply.ttl' is an integer */
              ~  ^
    build/temp.macosx-10.14-x86_64-3.9/_cares.c:4473:14: error: no member named 'ttl' in 'struct ares_srv_reply'
      (void)((p->ttl) | 0);  /* check that 'struct ares_srv_reply.ttl' is an integer */
              ~  ^
    build/temp.macosx-10.14-x86_64-3.9/_cares.c:4486:14: error: no member named 'ttl' in 'struct ares_txt_ext'
      (void)((p->ttl) | 0);  /* check that 'struct ares_txt_ext.ttl' is an integer */
              ~  ^
    build/temp.macosx-10.14-x86_64-3.9/_cares.c:4498:14: error: no member named 'ttl' in 'struct ares_txt_reply'
      (void)((p->ttl) | 0);  /* check that 'struct ares_txt_reply.ttl' is an integer */
              ~  ^
    build/temp.macosx-10.14-x86_64-3.9/_cares.c:4757:12: error: no member named 'ttl' in 'ares_mx_reply'
      { "ttl", offsetof(struct ares_mx_reply, ttl),
               ^                              ~~~
    /Library/Developer/CommandLineTools/usr/lib/clang/10.0.1/include/stddef.h:120:24: note: expanded from macro 'offsetof'
    #define offsetof(t, d) __builtin_offsetof(t, d)
                           ^                     ~
    build/temp.macosx-10.14-x86_64-3.9/_cares.c:4758:48: error: no member named 'ttl' in 'struct ares_mx_reply'
               sizeof(((struct ares_mx_reply *)0)->ttl),
                      ~~~~~~~~~~~~~~~~~~~~~~~~~~~  ^
    build/temp.macosx-10.14-x86_64-3.9/_cares.c:4781:12: error: no member named 'ttl' in 'ares_naptr_reply'
      { "ttl", offsetof(struct ares_naptr_reply, ttl),
               ^                                 ~~~
    /Library/Developer/CommandLineTools/usr/lib/clang/10.0.1/include/stddef.h:120:24: note: expanded from macro 'offsetof'
    #define offsetof(t, d) __builtin_offsetof(t, d)
                           ^                     ~
    build/temp.macosx-10.14-x86_64-3.9/_cares.c:4782:51: error: no member named 'ttl' in 'struct ares_naptr_reply'
               sizeof(((struct ares_naptr_reply *)0)->ttl),
                      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  ^
    build/temp.macosx-10.14-x86_64-3.9/_cares.c:4853:12: error: no member named 'ttl' in 'ares_soa_reply'
      { "ttl", offsetof(struct ares_soa_reply, ttl),
               ^                               ~~~
    /Library/Developer/CommandLineTools/usr/lib/clang/10.0.1/include/stddef.h:120:24: note: expanded from macro 'offsetof'
    #define offsetof(t, d) __builtin_offsetof(t, d)
                           ^                     ~
    build/temp.macosx-10.14-x86_64-3.9/_cares.c:4854:49: error: no member named 'ttl' in 'struct ares_soa_reply'
               sizeof(((struct ares_soa_reply *)0)->ttl),
                      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~  ^
    build/temp.macosx-10.14-x86_64-3.9/_cares.c:4871:12: error: no member named 'ttl' in 'ares_srv_reply'
      { "ttl", offsetof(struct ares_srv_reply, ttl),
               ^                               ~~~
    /Library/Developer/CommandLineTools/usr/lib/clang/10.0.1/include/stddef.h:120:24: note: expanded from macro 'offsetof'
    #define offsetof(t, d) __builtin_offsetof(t, d)
                           ^                     ~
    build/temp.macosx-10.14-x86_64-3.9/_cares.c:4872:49: error: no member named 'ttl' in 'struct ares_srv_reply'
               sizeof(((struct ares_srv_reply *)0)->ttl),
                      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~  ^
    build/temp.macosx-10.14-x86_64-3.9/_cares.c:4886:12: error: no member named 'ttl' in 'ares_txt_ext'
      { "ttl", offsetof(struct ares_txt_ext, ttl),
               ^                             ~~~
    /Library/Developer/CommandLineTools/usr/lib/clang/10.0.1/include/stddef.h:120:24: note: expanded from macro 'offsetof'
    #define offsetof(t, d) __builtin_offsetof(t, d)
                           ^                     ~
    build/temp.macosx-10.14-x86_64-3.9/_cares.c:4887:47: error: no member named 'ttl' in 'struct ares_txt_ext'
               sizeof(((struct ares_txt_ext *)0)->ttl),
                      ~~~~~~~~~~~~~~~~~~~~~~~~~~  ^
    build/temp.macosx-10.14-x86_64-3.9/_cares.c:4898:12: error: no member named 'ttl' in 'ares_txt_reply'
      { "ttl", offsetof(struct ares_txt_reply, ttl),
               ^                               ~~~
    /Library/Developer/CommandLineTools/usr/lib/clang/10.0.1/include/stddef.h:120:24: note: expanded from macro 'offsetof'
    #define offsetof(t, d) __builtin_offsetof(t, d)
                           ^                     ~
    fatal error: too many errors emitted, stopping now [-ferror-limit=]
    20 errors generated.
    error: command '/usr/bin/clang' failed with exit code 1
    ----------------------------------------
ERROR: Command errored out with exit status 1: /usr/local/opt/[email protected]/bin/python3.9 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/xn/8s6c14ws39v8x7gn13dpjj680000gp/T/pip-install-rsphcstm/pycares_e62e234778824ea1834667778e68b769/setup.py'"'"'; __file__='"'"'/private/var/folders/xn/8s6c14ws39v8x7gn13dpjj680000gp/T/pip-install-rsphcstm/pycares_e62e234778824ea1834667778e68b769/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/xn/8s6c14ws39v8x7gn13dpjj680000gp/T/pip-record-zthgkaej/install-record.txt --single-version-externally-managed --compile --install-headers /usr/local/include/python3.9/pycares Check the logs for full command output.

My apologies if the solution to this problem is blindingly obvious. I'm well and truly beyond the scope of my limited understanding here.

That said, if anyone would be willing to spend some time explaining what's going on here to a newb like me, and guiding me through the process of resolving this error, I would be immensely grateful.

like image 243
iamthelabhras Avatar asked Dec 06 '20 23:12

iamthelabhras


1 Answers

running brew unlink c-ares worked for me on my Macbook pro. See https://github.com/saghul/pycares/issues/102

like image 199
Luis Pedraza Avatar answered Sep 29 '22 23:09

Luis Pedraza