python - 在 64 位 Mac OSX 上的 64 位 python 解释器上构建“orjson”时,requirement.txt 安装失败
问题描述
为项目运行 requirements.txt 安装(快速 API)。以以下错误结束。我已经尝试了来自https://github.com/rust-lang/rust/issues/61925的方法,
并且我已经将 rust 设置为“夜间”使用rustup override set nightly
仍然面临错误。
Using cached orjson-3.4.3.tar.gz (1.2 MB)
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing wheel metadata ... error
ERROR: Command errored out with exit status 1:
command: /usr/local/opt/python@3.8/bin/python3.8 /usr/local/lib/python3.8/site-packages/pip/_vendor/pep517/_in_process.py prepare_metadata_for_build_wheel /var/folders/c7/0n1qpwb16l55dfdwqs4xt97dhw2m6y/T/tmpwyr1rz66
cwd: /private/var/folders/c7/0n1qpwb16l55dfdwqs4xt97dhw2m6y/T/pip-install-qmnttz7p/orjson
Complete output (13 lines):
maturin failed
Caused by: Cargo metadata failed. Do you have cargo in your PATH?
Caused by: Error during execution of `cargo metadata`: error: failed to run `rustc` to learn about target-specific information
Caused by:
process didn't exit successfully: `rustc - --crate-name ___ --print=file-names -Z mutable-noalias --crate-type bin --crate-type rlib --crate-type dylib --crate-type cdylib --crate-type staticlib --crate-type proc-macro --print=sysroot --print=cfg` (exit code: 1)
--- stderr
error: the option `Z` is only accepted on the nightly compiler
Checking for Rust toolchain....
Running `maturin pep517 write-dist-info --metadata-directory /private/var/folders/c7/0n1qpwb16l55dfdwqs4xt97dhw2m6y/T/pip-modern-metadata-c1upg8fc --interpreter /usr/local/Cellar/python@3.8/3.8.6_2/bin/python3.8 --manylinux=off --strip=on`
Error: Command '['maturin', 'pep517', 'write-dist-info', '--metadata-directory', '/private/var/folders/c7/0n1qpwb16l55dfdwqs4xt97dhw2m6y/T/pip-modern-metadata-c1upg8fc', '--interpreter', '/usr/local/Cellar/python@3.8/3.8.6_2/bin/python3.8', '--manylinux=off', '--strip=on']' returned non-zero exit status 1.
----------------------------------------
ERROR: Command errored out with exit status 1: /usr/local/opt/python@3.8/bin/python3.8 /usr/local/lib/python3.8/site-packages/pip/_vendor/pep517/_in_process.py prepare_metadata_for_build_wheel /var/folders/c7/0n1qpwb16l55dfdwqs4xt97dhw2m6y/T/tmpwyr1rz66 Check the logs for full command output.
请指教!谢谢!
解决方案
似乎错误与使用“Z”选项的 maturin 命令有关,该选项仅适用于夜间编译器。你可以先尝试安装
安装夜间工具链:
rustup 每晚安装
切换到 nightly 工具链作为默认工具链:
rustup 默认每晚
然后尝试安装这些依赖项。希望这有效!!!!
推荐阅读
- c++ - Cerrno 不工作,但 strerror 工作,在 Xcode (11.6)
- vue.js - 如何导入 grid.js html 函数以在 Vue 中使用格式化程序
- wordpress - WordPress 图像重复 - 正在创建许多额外的尺寸,我可以删除它们吗?
- r - 无法在 CentOS 7 和 R 4 上安装 rtracklayer
- karate - 我可以在测试中更改身份验证令牌方面获得一些帮助吗?
- java - 如何在 com.sun.jdi.ObjectReference 上中止长时间运行的 invokeMethod?
- c++ - QTcpSocket 未接收到服务器发送的数据
- php - 使用phpSpreadSheet读写excel文件后,图形消失
- java - 带有 React 的 Struts Web 应用程序
- css - 当一个类已经存在时如何实现一个 sr-only 类