我使用的是python 3.9.2。 我想在我创建的虚拟环境中安装 ccxt 包
python3 -m venv venv_cryptofolio
我遇到了一个错误,我将其发布在下面(但不是完整的,因为与问题描述相比它太大了,并且堆栈溢出不允许我发布它):
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
我尝试使用以下命令重新安装pycares:
pip install --upgrade --force-reinstall pycares
结果我遇到了类似的错误,如果需要的话我会在这里发布。
请问这是什么原因,有什么解决办法?
编辑:
我找到了删除cares文件的解决方案:
brew uninstall --ignore-dependencies c-ares
这是帮助我找到解决方案的资源:
我找到并回答了我在问题本身的底部发布的内容。
我也尝试使用 pip for python 安装 ccxt 但版本不同,也许 pip 的版本也不同。但是我在安装过程中遇到了两个错误,我对此问题进行了一些研究,但目前我找不到任何有效的解决方案。由于 Rust 1.63.0 没有发布版本,最好的解决方案是等待版本发布还是有其他方法让它工作?在某处读到密码学的版本可能与此有关。我不确定为什么我在使用 pycares 时遇到错误。 希望有人能解决这个问题。预先感谢。
Python 3.11.9,pip 24.0
密码学构建轮子(pyproject.toml)...错误 错误:子进程退出并出现错误 密码学构建轮 (pyproject.toml) 未成功运行。 退出代码:1
错误:找不到 Rust 编译器
该软件包需要 Rust >=1.63.0。 注意:此错误源自子进程,并且可能不是 pip 的问题。错误:密码学构建轮子失败
pycares 的构建轮子 (pyproject.toml) ... 错误
错误:子进程退出并出现错误
pycares 的构建轮 (pyproject.toml) 未成功运行。 退出代码:1
注意:此错误源自子进程,并且可能不是 pip 的问题。
错误:为 pycares 构建轮子失败
无法构建加密 pycares 错误:无法构建加密 pycares 的轮子,这是安装基于 pyproject.toml 的项目所必需的