ImportError: No module named 'pycocotools'

 

错误原因很简单,就是缺少了pycocotools这个包,首先你需要pip install pycocotools,看少了什么包没安装,我这里少了Cython

于是我又安装了Cython,然后再安装pycocotools,就OK了

 

上面是在linux上面比较简单,下面看window上面:

看这个博客https://blog.csdn.net/heiheiya/article/details/81128749

命令是:pip install git+https://github.com/philferriere/cocoapi.git#subdirectory=PythonAPI

 

 

以下安装说明是错误的,我留这里只是为了记录我寻找vc14的安装过程:

安装完Cython之后,直接安装pip install pycocotools可能会报:

building 'pycocotools._mask' extension
error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual
C++ Build Tools": http://landinghub.visualstudio.com/visual-cpp-build-tools

 

说明少vc14,这是python3.5和3.6会发生的事情,感兴趣的可以先去https://wiki.python.org/moin/WindowsCompilers看看

不感兴趣的直接下载https://visualstudio.microsoft.com/zh-hans/downloads/

 

posted @ 2018-05-15 10:58  唐淼  阅读(14257)  评论(0编辑  收藏  举报