7

这是我第一次在 Stack Overflow 上发帖,所以我对任何无意的畏缩表示歉意。

我正在尝试在运行 macOS Mojave 版本 10.14.6 的 Macbook Pro(2013 年末)上安装 twint。

当我运行命令时:

pip3 install twint==2.1.4 fire tqdm

一切似乎都运行良好......直到我的机器进入 pycares 部分。

那时,我收到了这个非常长的错误消息:

  Building wheel for pycares (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: /usr/local/opt/python@3.9/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/openssl@1.1/include -I/usr/local/opt/sqlite/include -I/usr/local/Cellar/python@3.9/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/python@3.9/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/openssl@1.1/include -I/usr/local/opt/sqlite/include -I/usr/local/Cellar/python@3.9/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/python@3.9/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.

如果这个问题的解决方案非常明显,我深表歉意。我在这里完全超出了我有限的理解范围。

也就是说,如果有人愿意花一些时间向像我这样的新手解释这里发生了什么,并指导我完成解决这个错误的过程,我将非常感激。

4

1 回答 1

23

runningbrew unlink c-ares在我的 Macbook pro 上为我工作。见https://github.com/saghul/pycares/issues/102

于 2021-01-28T09:42:59.743 回答