pip install pycocotools==2.0.3 报错:
gcc -pthread -B /home/user/.conda/envs/TZY_MaskRCNN/compiler_compat -Wl,--sysroot=/ -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/home/user/.conda/envs/TZY_MaskRCNN/lib/python2.7/site-packages/numpy/core/include -I./common -I/home/user/.conda/envs/TZY_MaskRCNN/include/python2.7 -c ../common/maskApi.c -o build/temp.linux-x86_64-2.7/../common/maskApi.o -Wno-cpp -Wno-unused-function -std=c99
gcc: error: ../common/maskApi.c: 没有那个文件或目录
error: command 'gcc' failed with exit status 1
![](https://i-blog.csdnimg.cn/blog_migrate/5dc3471184e6d298b8ab1632971f2359.png)
安装 pycocotools 2.0.3 版本时出现如上错误,而安装 2.0.6 版本时不会有如上错误。
解决方法:
先安装较低版本的cpython:
pip install cython==0.29.36
然后再安装pycocotools2.0.3
pip install pycocotools==2.0.3
![](https://i-blog.csdnimg.cn/blog_migrate/5e19e6dea4e6704a579b66ca66d13b5d.png)