Python安裝jupyter notebook報pywinpty缺少Rust和Cargo問題
問題描述
Python 執(zhí)行安裝 pip install jupyter 命令報這個錯誤:
ERROR: Command errored out with exit status 1:
command: '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'
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 installer ,按照網站上的指示下載并安裝 Rust。
安裝過程中,確保選擇將 Rust 添加到系統(tǒng)路徑中,以便在命令行中可以訪問 rustc 和 cargo
重啟電腦后再次執(zhí)行就可安裝成功了
pip install jupyter
總結
以上為個人經驗,希望能給大家一個參考,也希望大家多多支持腳本之家。
相關文章
Python Multiprocessing多進程 使用tqdm顯示進度條的實現
這篇文章主要介紹了Python Multiprocessing多進程 使用tqdm顯示進度條的實現,文中通過示例代碼介紹的非常詳細,對大家的學習或者工作具有一定的參考學習價值,需要的朋友可以參考下2019-08-08
python使用BeautifulSoup分析網頁信息的方法
這篇文章主要介紹了python使用BeautifulSoup分析網頁信息的方法,涉及Python使用BeautifulSoup模塊分析網頁信息的技巧,非常具有實用價值,需要的朋友可以參考下2015-04-04

