No module named pycocotools
尝试使用pip install pycocotools失败,于是直接下载了packages放进环境中,使用conda list查看已有包,pycocotools显示存在,但是运行时,仍然报错No module named 'pycocotools._mask ’。
ImportError: cannot import name ‘_mask‘ from ‘pycocotools‘
尝试诸多办法后(git clone、coco-master下载后直接python setup.py build_ext --inplace等等方法)一些奇怪的问题,包括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/(不过这个错误可以继续尝试该博文采取的办法,我觉得麻烦就又试了试别的方法2)
最后尝试:
conda install -c conda-forge pycocotools
问题解决囖!