使用pip安装jupyter笔记本时出错:准备元数据(pyproject.toml)未成功运行

问题描述 投票:0回答:1

错误:子进程退出并出现错误

× 准备元数据(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-3.x jupyter-notebook rust-cargo
1个回答
0
投票

出现此错误是因为某些 Python 包需要 RustCargo 来编译本机扩展。这些通常是涉及性能关键任务或密码学的低级库,并且它们使用 Rust 作为构建过程的一部分。 Jupyter Notebook安装过程中的依赖项之一依赖于用 Rust 编写的包。

解决此问题:

解决此问题的最佳方法是从 anaconda/download 下载 AnacondaMiniconda。 Anaconda 预装了 Jupyter,因此避免了 Rust 依赖问题。

注意:我也曾经遇到过一个解决方案,它说我们可以通过从 rust-lang/tools/install 安装 rustcargo (rust 的包管理器)来解决这个错误,它也通过以下方式安装货物-默认。 即使尝试了这个之后,我又遇到了同样的错误。 所以我不推荐这种方法。

希望这对您有帮助。

© www.soinside.com 2019 - 2024. All rights reserved.