错误:子进程退出并出现错误
× 准备元数据(pyproject.toml)未成功运行。 │ 退出代码:1 ╰─>【6行输出】
Cargo, the Rust package manager, is not installed or is not on PATH.
**This package requires Rust and Cargo to compile extensions.** Install it through
the system's package manager or via [https://rustup.rs/](https://rustup.rs/)
Checking for Rust toolchain....
[end of output]
注意:此错误源自子进程,并且可能不是 pip 的问题。 错误:元数据生成失败
× 生成包元数据时遇到错误。 ╰─> 输出见上文。
我期待有人解释为什么会发生这种情况以及如何解决它。
出现此错误是因为某些 Python 包需要 Rust 和 Cargo 来编译本机扩展。这些通常是涉及性能关键任务或密码学的低级库,并且它们使用 Rust 作为构建过程的一部分。 Jupyter Notebook安装过程中的依赖项之一依赖于用 Rust 编写的包。
解决此问题:
解决此问题的最佳方法是从 anaconda/download 下载 Anaconda 或 Miniconda。 Anaconda 预装了 Jupyter,因此避免了 Rust 依赖问题。
注意:我也曾经遇到过一个解决方案,它说我们可以通过从 rust-lang/tools/install 安装 rust 和 cargo (rust 的包管理器)来解决这个错误,它也通过以下方式安装货物-默认。 即使尝试了这个之后,我又遇到了同样的错误。 所以我不推荐这种方法。
希望这对您有帮助。