安装PyCaret时遭遇subprocess-exited-with-error报错求助
解决PyCaret安装时numpy相关的subprocess-exited-with-error问题
报错现象
执行!pip install pycaret时触发以下错误:
error: subprocess-exited-with-error
pip subprocess to install build dependencies did not run successfully.
exit code: 1
note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure
Encountered error while trying to install package.
numpy
note: This is an issue with the package mentioned above, not pip.
解决方案
- 先升级pip、setuptools和wheel,确保构建工具为最新版本:
!pip install --upgrade pip setuptools wheel - 单独安装稳定兼容版本的numpy,再安装PyCaret:
!pip install numpy==1.26.4 !pip install pycaret - 检查Python版本兼容性:PyCaret要求Python 3.8-3.11版本,若当前环境版本不在此范围,切换到符合要求的Python环境后再尝试安装。
- 若有conda环境,可优先用conda安装预编译的numpy包(避免构建问题),再安装PyCaret:
!conda install numpy -y !pip install pycaret
内容的提问来源于stack exchange,提问作者Agha Zohaib
相关产品推荐
相关产品推荐

