执行pip install super_gradients出现subprocess-exited-with-error错误求助
解决pycocotools编译失败导致super_gradients安装报错的问题
报错核心原因是pycocotools需要编译依赖,缺少系统级编译工具或依赖库导致构建wheel失败,以下分系统给出解决步骤:
Windows系统
- 安装Microsoft Visual C++ Build Tools,安装时勾选「C++构建工具」及对应版本的Windows SDK组件,完成后重启Jupyter Notebook。
- 优先尝试安装预编译版本的pycocotools:
pip install pycocotools-windows - 再执行原安装命令:
pip install super_gradients
Linux系统(以Ubuntu/Debian为例)
- 安装编译依赖包:
sudo apt-get update && sudo apt-get install gcc python3-dev libgl1-mesa-glx libglib2.0-0 -y - 重新运行安装命令:
pip install super_gradients
macOS系统
- 安装Xcode命令行工具:
xcode-select --install - 确保Python环境依赖完整,可通过Homebrew更新Python:
brew install python3 - 执行原安装命令:
pip install super_gradients
通用替代方案(跨系统)
- 使用conda安装预编译的pycocotools:
conda install -c conda-forge pycocotools - 完成后再安装super_gradients:
pip install super_gradients
内容的提问来源于stack exchange,提问作者Ирина Соловьева
相关产品推荐
相关产品推荐

