【深度學習】Windows安裝Pycocotools(Microsoft Visual C++ 14.0 or greater is required.報錯提示解決方案)


✨Pycocotools

很多深度學習項目會用到Pycocotools

一般直接在conda環境下運行

pip install pycocotools

或者使用阿里鏡像源安裝

pip install pycocotools -i https://mirrors.aliyun.com/pypi/simple/

在Windows下直接運行該命令可能出現如下報錯提示

error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools"

提示需要 Microsoft Visual C++ 14.0


下面給出兩種解決方案


✨解決方案一

安裝 Visual C++ 2015 build tools

點擊以下鏈接

GitHub - philferriere/cocoapi: Clone of COCO API - Dataset @ http://cocodataset.org/ - with changes to support Windows build and python3

點擊 “here” 下載

或者直接點擊 Visual C++ 2015 build tools 下載鏈接


點擊安裝


(有可能失敗 網絡原因或者提示安裝包丟失或者損壞)


如果安裝成功后再運行

pip install pycocotools

Pycocotools安裝成功


✨解決方案二

安裝 Visual Studio 2019 以下內容

  • 工作負載:使用C++的桌面開發
  • 安裝組件:適用於v142 的 C++ Clang-cl 生成工具(x64/x86)

!注意:適用於v142 的 C++ Clang-cl 生成工具(x64/x86) 組件必須安裝


下載 Visual Studio 2019 安裝程序

下載 Windows 版和 Mac 版 Visual Studio 2019 (microsoft.com)

在 “單個組件” 中搜索 build

勾選 “適用於v142 的 C++ Clang-cl 生成工具(x64/x86)”


安裝成功后再運行

pip install pycocotools

Pycocotools安裝成功


✨參考及引用

https://blog.csdn.net/qq_37705280/article/details/111053515

https://www.bilibili.com/video/BV1tf4y1t7ru?p=2


⭐轉載請注明出處

本文作者:雙份濃縮馥芮白

原文鏈接:https://www.cnblogs.com/Flat-White/p/15123308.html

版權所有,如需轉載請注明出處。


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM