c:\users\shamsa\appdata\local\programs\python\python38-32\lib\site-packages (from stack-data->ipython>=4.0.0->ipywidgets) (2.0.5)
Requirement already satisfied: pure-eval in c:\users\shamsa\appdata\local\programs\python\python38-32\lib\site-packages (from stack-data->ipython>=4.0.0->ipywidgets) (0.2.2)
Collecting zipp>=3.1.0
Using cached zipp-3.7.0-py3-none-any.whl (5.3 kB)
Requirement already satisfied: six>=1.5 in c:\users\shamsa\appdata\local\programs\python\python38-32\lib\site-packages (from python-dateutil>=2.1->jupyter-client<8.0->ipykernel>=4.5.1->ipywidgets) (1.16.0)
Collecting pywinpty>=1.1.0
Using cached pywinpty-2.0.2.tar.gz (22 kB)
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing metadata (pyproject.toml) ... error
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/
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.
note: This is an issue with the package mentioned above, not pip.
hint: See above for details.我的pip版本为22.0.3,python版本为3.8.0,尽管我从提供的错误消息中的链接安装了错误(abd遵循说明),但错误仍然存在。
这是我的货版
PS C:\Users\Shamsa> cargo -V
cargo 1.59.0 (49d8809dc 2022-02-10)并安装了锈蚀
PS C:\Users\Shamsa> rustup show
Default host: x86_64-pc-windows-msvc
rustup home: C:\Users\Shamsa\.rustup
stable-x86_64-pc-windows-msvc (default)
rustc 1.59.0 (9d1b2106e 2022-02-23)对错误的更新
我没有做任何更改,只是再次运行命令pip install ipywidgets,它生成了这个错误
Collecting pywinpty>=1.1.0
Using cached pywinpty-2.0.2.tar.gz (22 kB)
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing metadata (pyproject.toml) ... error
error: subprocess-exited-with-error
× Preparing metadata (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [24 lines of output]
💥 maturin failed
Caused by: Cargo metadata failed. Does your crate
compile with `cargo build`?
Caused by: `cargo metadata` exited with an error:
Updating crates.io index
warning: spurious network error (2 tries remaining): failed to read data: The server returned an invalid or unrecognized response
; class=Os (2)
warning: spurious network error (1 tries remaining): failed to read data: The server returned an invalid or unrecognized response
; class=Os (2)
error: failed to get `pyo3` as a dependency of package `pywinpty v2.0.2 (C:\Users\Shamsa\AppData\Local\Temp\pip-install-mrl995n0\pywinpty_2079790bb492449abb31454ef2581cb6)`
Caused by:
failed to load source for dependency `pyo3`
Caused by:
Unable to update registry `crates-io`
Caused by:
failed to fetch `https://github.com/rust-lang/crates.io-index`
Caused by:
failed to read data: The server returned an invalid or unrecognized response
; class=Os (2)
Error running maturin: Command '['maturin', 'pep517'hamsa\\AppData\\Local\\Temp\\pip-modern-metadata-_naf8t69'hamsa\\AppData\\Local\\Temp\\pip-modern-metadata-_naf8t69', '--interpreter', 'c:\\users\\shamsa\\agrams\\python\\python38-32\\python.exe']' returned non-zerocal\\programs\\python\\python38-32\\python.exe']o exit status 1.
Checking for Rust toolchain.... odern-metadata-_naf8t69 --interpreter c:\users\sh
Running `maturin pep517 write-dist-info --metadata-directory C:\Users\Shamsa\AppData\Local\Temp\pip-mirectory C:\Users\Shamsa\AppData\Local\Temp\pip-modern-metata\local\programs\python\python38-32\python.exe`\programs\python\python38-32\python.exe`
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.kely not a problem with pip.
error: metadata-generation-failed
× Encountered error while generating package metadata.
╰─> See above for output.发布于 2022-02-28 21:48:50
您是否检查过cargo是否在您的路径上,如错误消息所述?
添加到路径环境变量中,如下所示:
cargo安装的路径。如果没有,请按照消息中的说明,确保它是从这里安装的。该链接包含这样做的说明。
如果问题仍然存在,请尝试通过
pip install --upgrade pip然后运行命令,
pip install ipywidgets正如这些答案对类似问题的建议。
如果错误消息仍然存在,或更改,请更新您的答案。
如果您提供了Pythonandpip版本,也会很有用。
https://stackoverflow.com/questions/71301060
复制相似问题