window10環境下安裝pycocotools報錯及解決辦法

安裝pycocotools時,首先遇到的是錯誤1,經過一番折騰終於解決。但又出現錯誤2,唉接着解決。。。

在windows下可能會出現以下錯誤:

錯誤1:

img

解決辦法:

因爲沒有Visual C++ 編譯環境。解決方式:
安裝Build Tools for Visual Studio 2017 (2015版及以後就行,不需要安裝整個vs)

安裝過程我都選擇了默認安裝,安裝成功,問題解決。

錯誤2:

cl : Command line error D8021 : invalid numeric argument '/Wno-cpp'
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\BIN\\x86_amd64\\cl.exe' failed with exit status 2
----------------------------------------
ERROR: Failed building wheel for pycocotools

解決辦法:

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

即可安裝成功。

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章