开发者

Python安装jupyter notebook报pywinpty缺少Rust和Cargo问题

开发者 https://www.devze.com 2025-03-19 09:54 出处:网络 作者: 星空椰
目录问题描述原因分析解决方案总结问题描述 python 执行安装 pip install jupyter 命令报这个错误:
目录
  • 问题描述
  • 原因分析
  • 解决方案
  • 总结

问题描述

python 执行安装 pip install jupyter 命令报这个错误:

ERROR: Command errored out with exit status 1:

command: 'e:\XXX\python\python.exe' 'e:\XXX\python\lib\sitjavascripte-packages\pip\_vendor\pep517\_in_process.py' prepare_metadata_for_build_wheel 'C:\Users\xxx\AppData\Local\Temp\tmpg764gw5c'

cwd: C:\Users\xxx\AppData编程客栈Local\Temp\pip-install-cmivv4zn\pywinpty

Complete output (6 lines):

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....

----------------------------------------

ERROR: Command errored out with exit status 1: 'e:\XXX\python\python.exe' 'e:\XXX\python\lib\site-packages\pip\_vendor\pep517\_in_process.py' prepare_metadata_for_build_wheel 'C:\Users\xxx\AppData\Local\Temp\tmpg764gw5c' Check the logs for full command output.

原因分析

因为缺少 Rust 和 Cargo 导致的,我先后用了升级 pip 和 setuptools都没有解决

python -m pip install --upgrade pip
python -m pip install --upgrade pip

重新用命令安装这个包也不成功,都可以试试

pip install --upgrade pywinpty

解决方案

访问 rustup.rs - The Rust toolchain installerjs ,按照网站上的指示下载并安装 Rust。

安装过程中,确保选择将 Rust 添加到系统路径中,以便在命令行中可以访问 rustc NDfbXcargo

重启电脑后再次执行就可安装成功了

pipjavascript install jupyter

总结

以上为个人经验,希望能给大家一个参考,也希望大家多多支持编程客栈(www.devze.com)。

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号