(个人记录)安装pycocotools库出现Could not build wheels for pycocotools which use PEP 517 and cannot be install

事先声明,问题已经解决,本文章为记录尝试过程以及最终解决方案。

本人使用的pycharm

第一次在pycharm中的Settings里尝试安装pycocotools时pycharm报错:

Try to run this command from the system terminal. Make sure that you use the correct version of 'pip' installed foryour Python interpreter located at 'D:\Anaconda\envs\pytorch\python.exe'.

之后在anaconda软件中使用conda search进行搜索发现没有这个包,第二次上网搜索解决方法,尝试在'D:\Anaconda\envs\pytorch\'路径下打开命令窗口,输入python.exe -m pip install pycocotools -i http://pypi.douban.com/simple --trusted-host pypi.douban.com。(豆瓣国内源),于是出现了新的错误:

Could not build wheels for pycocotools which use PEP 517 and cannot be installed directly

并建议我安装Microsoft Visual C++,由于太大,本人不想安装,于是寻找其他方法。

第三次尝试在anaconda的命令行中输入pip install pycocotools(摆烂试一下)发现与第二次尝试结果相同。

第四次上网搜索发现有人使用conda install pycocotools命令可以下载,试了下发现仍然不行,但anaconda中给出建议可以上网站https://anaconda.org中进行搜索查看,进入网站搜索pycocotools后发现应该是有人上传过这个包

(个人记录)安装pycocotools库出现Could not build wheels for pycocotools which use PEP 517 and cannot be install_第1张图片选择第一个搜索结果后,发现下面有可以直接运行的命令

(个人记录)安装pycocotools库出现Could not build wheels for pycocotools which use PEP 517 and cannot be install_第2张图片

选择了第一个命令进行安装,最终成功。 

你可能感兴趣的:(python,pycharm,开发语言)