1、导入 pycocotools解决:
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
相信大家肯定被这个导入苦恼了不少时间,作为小白的我也是,这里有一个非常简单的方法解决此问题,首先说说网上目前有的两种方法,我反正是没有成功的。
- 下载Microsoft Visual C++ 14.0整套,咱们也就需要一个依赖去跑人工智能相关项目。不值得,所以我没有事,但有同学试试了,有的行有的不行。
- 导入更新pip,然后输入下列代码,(有人解决了有人没有)
pip install git+https://github.com/philferriere/cocoapi.git#subdirectory=PythonAPI2、解决办法只需要两步(附上成功截图)
去清华镜像下载对应的.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报错解决方案。



