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

解决:
ERROR: Command errored out with exit status 1:
creating build\lib.win-amd64-3.8
creating build\lib.win-amd64-3.8\pycocotools
copying pycocotools\coco.py -> build\lib.win-amd64-3.8\pycocotools
copying pycocotools\cocoeval.py -> build\lib.win-amd64-3.8\pycocotools
copying pycocotools\mask.py -> build\lib.win-amd64-3.8\pycocotools
copying pycocotools_init_.py -> build\lib.win-amd64-3.8\pycocotools
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:\Anaconda3\Include\pycocotools’ 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报错解决方案

  • 30
    点赞
  • 58
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 18
    评论
评论 18
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

锦鲤AI幸运

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值