pycocotools安装失败
一开始就正常的:
pip3 install pycocotools
报错:
后面尝试了几种方案:
- 换源:换清华源和豆瓣源,失败
pip3 install pycocotools -i https://pypi.tuna.tsinghua.edu.cn/simple/ --trusted-host pypi.tuna.tsinghua.edu.cn
- 按GitHub上说的:失败(这两种方案都有可能成功的,但是我连接的服务器一直显示无法连接到GitHub)
pip3 install git+https://github.com/philferriere/cocoapi.git#egg=pycocotools^&subdirectory=PythonAPI
-
在清华源上下载再本地安装,下载地址:
https://pypi.tuna.tsinghua.edu.cn/simple/pycocotools/
安装:pip3 install pycocotools-2.0.0.tar.gz
失败 -
最后查看报错信息,发现一条:
因此先执行命令:sudo apt-get install python3.7-dev
再本地安装:pip3 install pycocotools-2.0.0.tar.gz
成功!