栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > Python

ERROR: Failed building wheel for pycocotools,解决pip导入pycocotools报错,无需下载Microsoft Visual C++

Python 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

ERROR: Failed building wheel for pycocotools,解决pip导入pycocotools报错,无需下载Microsoft Visual C++

解决:
ERROR: Command errored out with exit status 1:
creating buildlib.win-amd64-3.8
creating buildlib.win-amd64-3.8pycocotools
copying pycocotoolscoco.py -> buildlib.win-amd64-3.8pycocotools
copying pycocotoolscocoeval.py -> buildlib.win-amd64-3.8pycocotools
copying pycocotoolsmask.py -> buildlib.win-amd64-3.8pycocotools
copying pycocotools_init_.py -> buildlib.win-amd64-3.8pycocotools
running build_ext
skipping ‘pycocotools_mask.c’ Cython extension (up-to-date)
building ‘pycocotools._mask’ extension
error: Microsoft Visual C++ 14.0 or greater is required. Get it with “Microsoft C++ Build Tools”: https://visualstudio.microsoft.com/visual-cpp-build-tools/
----------------------------------------
ERROR: Command errored out with exit status 1: ’ --single-version-externally-managed --compile --install-headers ‘D:Anaconda3Includepycocotools’ Check the logs for full command output

1、导入 pycocotools

    相信大家肯定被这个导入苦恼了不少时间,作为小白的我也是,这里有一个非常简单的方法解决此问题,首先说说网上目前有的两种方法,我反正是没有成功的。

  1. 下载Microsoft Visual C++ 14.0整套,咱们也就需要一个依赖去跑人工智能相关项目。不值得,所以我没有事,但有同学试试了,有的行有的不行。
  2. 导入更新pip,然后输入下列代码,(有人解决了有人没有)
 pip install git+https://github.com/philferriere/cocoapi.git#subdirectory=PythonAPI
2、解决办法只需要两步(附上成功截图)

   去清华镜像下载对应的.whl文件,https://pypi.tuna.tsinghua.edu.cn/simple/进入网址后Ctrl+F 找pycocotools-windows即可,根据自己的版本上调或者下挑版本。(作者是python3.8)

#然后下载本地cp38版本的pycocotools即可
pip install D:浏览器下载pycocotools_windows-2.0.0.2-cp38-cp38-win_amd64.whl


   然后就可以运行自己的人工智能项目了,欢迎互相关注相互学习。之前还有一片是导入“shapely” ,方法与这个差不多,点我跳转到shapely报错解决方案。

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/294242.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号