You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

已安装Visual Studio C++构建工具,pip安装pycocotools仍报错

pycocotools安装失败的解决办法
  • 确认Python版本为64位,执行python -c "import platform; print(platform.architecture())"查看,32位环境大概率会编译失败
  • 升级pip至最新版本:python -m pip install --upgrade pip
  • 跳过源码编译,直接安装预编译wheel包:
    1. 找到对应Python版本和系统架构的pycocotools预编译wheel文件(可在Python非官方预编译包仓库获取)
    2. 执行本地安装命令:pip install 下载的wheel文件名.whl
  • 检查Visual Studio C++工具配置:
    1. 打开Visual Studio Installer,确保**Desktop development with C++**组件下的MSVC构建工具、对应版本Windows SDK已全部安装
    2. 运行VC环境配置脚本:比如64位环境执行"C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvars64.bat"(路径根据你的VS版本调整),之后再执行pip install pycocotools
  • 用conda安装替代pip:conda install -c conda-forge pycocotools

内容的提问来源于stack exchange,提问作者Zhang Henry

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.05 06:10:29