JustCode
JustCode

Reputation: 1

Error while installing jupyter notebook with pip: Preparing metadata (pyproject.toml) did not run successfully

error: subprocess-exited-with-error

× Preparing metadata (pyproject.toml) did not run successfully. │ exit code: 1 ╰─> [6 lines of output]

  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]

note: This error originates from a subprocess, and is likely not a problem with pip. error: metadata-generation-failed

× Encountered error while generating package metadata. ╰─> See above for output.

I am expecting someone to explain why this is occurring and how can I resolve it.

Upvotes: 0

Views: 935

Answers (1)

ANAND YADAV
ANAND YADAV

Reputation: 11

This error arises because certain Python packages require Rust and Cargo for compiling native extensions. These are usually low-level libraries that involve performance-critical tasks or cryptography, and they use Rust as part of their build process. One of the dependencies in the Jupyter Notebook installation process relies on a package written in Rust.

Resolving this issue:

The best way to tackle this issue is to download Anaconda or Miniconda from anaconda/download. Anaconda comes with Jupyter pre-installed and hence avoids the Rust dependency issue.

Note: I also once came across a solution which says that we can resolve this error by installing rust and cargo (package manager of rust) from rust-lang/tools/install which also installs cargo by-default. Even after trying this, I got the same error again. So I do not recommend this method.

Hope this is helpful.

Upvotes: 0

Related Questions