安装 web3[tester] 时出错:blake2b-py

问题描述

我正在尝试使用 pip install -U web3[tester] 安装 web3 测试器,但总是收到此错误

Pip 和 setuptools 都是当前版本。

完整的错误

Building wheels for collected packages: blake2b-py
  Building wheel for blake2b-py (PEP 517) ... error
  ERROR: Command errored out with exit status 1:
   command: /Library/Frameworks/Python.framework/Versions/3.9/bin/python3.9 /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pip/_vendor/pep517/_in_process.py build_wheel /var/folders/rf/h_h1jw411_l1d366hm2pybm00000gn/T/tmpigyl8c27
       cwd: /private/var/folders/rf/h_h1jw411_l1d366hm2pybm00000gn/T/pip-install-yu97ljpj/blake2b-py_61e5c1e928bf4c3fa77c17397812b60f
  Complete output (20 lines):
     Compiling proc-macro2 v1.0.24
     Compiling unicode-xid v0.2.1
     Compiling syn v1.0.58
     Compiling proc-macro-hack v0.5.19
     Compiling memchr v2.3.4
     Compiling serde_derive v1.0.118
     Compiling serde v1.0.118
     Compiling ryu v1.0.5
     Compiling lazy_static v1.4.0
     Compiling serde_json v1.0.61
  error: Could not compile `ryu`
  
  To learn more,run the command again with --verbose.
  warning: build Failed,waiting for other jobs to finish...
  error: build Failed
  ? maturin Failed
    Caused by: Failed to build a native library through cargo
    Caused by: Cargo build finished with "exit code: 101": `cargo rustc --message-format json --manifest-path Cargo.toml --lib --release -- -C link-arg=-undefined -C link-arg=dynamic_lookup`
  Running `maturin pep517 build-wheel -i python`
  Error: Command '['maturin','pep517','build-wheel','-i','python']' returned non-zero exit status 1.
  ----------------------------------------
  ERROR: Failed building wheel for blake2b-py
Failed to build blake2b-py
ERROR: Could not build wheels for blake2b-py which use PEP 517 and cannot be installed directly

当我再次使用 --verbose 运行命令时,我得到:


错误:无法为 pyo3 v0.8.5 运行自定义构建命令

原因: 进程未成功退出/private/var/folders/rf/h_h1jw411_l1d366hm2pybm00000gn/T/pip-install-ewvt5uxi/blake2b-py_af0db53ab76c4fb48590a7692b7f3b09/target/release/build/pyo3-3ab2c629ff3fb44d/build-script-build退出代码:101) --- 标准错误 线程 'main' 在 'Error: pyo3 requires a nightly or dev version of Rust.' 中恐慌,/Users/Pancake/.cargo/registry/src/github.com-1ecc6299db9ec823/pyo3-0.8.5/build.rs:542 :9 注意:使用 RUST_BACKTRACE=1 环境变量运行以显示回溯 ? maturin 失败 引起:通过cargo构建原生库失败 原因:货物构建完成,“退出代码:101”:cargo rustc --message-format json --manifest-path Cargo.toml --lib --release -- -C link-arg=-undefined -C link-arg=dynamic_lookup 运行maturin pep517 build-wheel -i python 错误:命令 '['maturin','python']' 返回非零退出状态 1。 blake2b-py (PEP 517) 的构建轮......错误 错误:blake2b-py 的构建轮失败 无法构建 blake2b-py 错误:无法为使用 PEP 517 且无法直接安装的 blake2b-py 构建轮子 异常信息: 回溯(最近一次调用最后一次): 文件“/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pip/_internal/cli/base_command.py”,第 224 行,在 _main status = self.run(options,args) 文件“/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pip/_internal/cli/req_command.py”,第180行,包装器 返回函数(自我,选项,参数) 文件“/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pip/_internal/commands/install.py”,第361行,运行中 引发安装错误( pip._internal.exceptions.InstallationError:无法为使用 PEP 517 且无法直接安装的 blake2b-py 构建轮子 删除了构建跟踪器:'/private/var/folders/rf/h_h1jw411_l1d366hm2pybm00000gn/T/pip-req-tracker-zvzjdf19'

解决方法

stderr 线程“main”因“错误:pyo3 需要夜间版或开发版 Rust”而恐慌。

你必须安装 Rust 的 nightly 或 dev 版本(你安装了 Rust 吗?)

编辑 你可以在 macOS 上每晚在 shell 中使用以下命令安装 Rust:

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
rustup default nightly

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...