最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

Windows安裝pycocotools的問題報錯解決

 更新時間:2024年06月11日 09:48:09   作者:王大隊長  
最近使用pip install安裝pycocotools出現(xiàn)錯誤,本文主要介紹了Windows安裝pycocotools的問題報錯解決,具有一定的參考價值,感興趣的可以了解一下

pycocotools庫的簡介

pycocotools即python api tools of COCO。COCO是一個大型的圖像數(shù)據(jù)集,用于目標檢測、分割、人的關(guān)鍵點檢測、素材分割和標題生成。這個包提供了Matlab、Python和luaapi,這些api有助于在COCO中加載、解析和可視化注釋。請訪問COCO - Common Objects in Context,可以了解關(guān)于COCO的更多信息,包括數(shù)據(jù)、論文和教程。COCO網(wǎng)站上也描述了注釋的確切格式。Matlab和PythonAPI是完整的,LuaAPI只提供基本功能。

直接用下面的代碼pip install 會報錯

pip install pycocotools-win

報錯信息:

ERROR: Command errored out with exit status 1:
   command: 'D:\Anaconda\anaconda\envs\pytorch1.10.1\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'D:\\temp\\pip-install-48raidr9\\pycocotools-win_9d4ff4791ad241a99d6dd3ac703b0b51\\setup.py'"'"'; __file__='"'"'D:\\temp\\pip-install
-48raidr9\\pycocotools-win_9d4ff4791ad241a99d6dd3ac703b0b51\\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"
'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d 'D:\temp\pip-wheel-e6slyu_q'
       cwd: D:\temp\pip-install-48raidr9\pycocotools-win_9d4ff4791ad241a99d6dd3ac703b0b51\
  Complete output (23 lines):
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build\lib.win-amd64-3.9
  creating build\lib.win-amd64-3.9\pycocotools
  copying pycocotools\coco.py -> build\lib.win-amd64-3.9\pycocotools
  copying pycocotools\cocoeval.py -> build\lib.win-amd64-3.9\pycocotools
  copying pycocotools\mask.py -> build\lib.win-amd64-3.9\pycocotools
  copying pycocotools\__init__.py -> build\lib.win-amd64-3.9\pycocotools
  running build_ext
  cythoning pycocotools/_mask.pyx to pycocotools\_mask.c
  D:\Anaconda\anaconda\envs\pytorch1.10.1\lib\site-packages\Cython\Compiler\Main.py:369: FutureWarning: Cython directive 'language_level' not set, using 2 for now (Py2). This will change in a later release! File: D:\temp\pip-install-48raidr9\pycocotools-win_9d4ff47
91ad241a99d6dd3ac703b0b51\pycocotools\_mask.pyx
    tree = Parsing.p_module(s, pxd, full_module_name)
  building 'pycocotools._mask' extension
  creating build\temp.win-amd64-3.9
  creating build\temp.win-amd64-3.9\common
  creating build\temp.win-amd64-3.9\Release
  creating build\temp.win-amd64-3.9\Release\pycocotools
  "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.20.27508\bin\HostX86\x64\cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD -ID:\Anaconda\anaconda\envs\pytorch1.10.1\lib\site-packages\numpy\core\include -I../common -ID:\Anaconda\anaconda
\envs\pytorch1.10.1\include -ID:\Anaconda\anaconda\envs\pytorch1.10.1\Include "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.20.27508\ATLMFC\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC
\14.20.27508\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\um" "-IC:\Program Files (x86)\Windows Ki
ts\10\include\10.0.17763.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\cppwinrt" /Tc../common/maskApi.c /Fobuild\temp.win-amd64-3.9\Release\../common/maskApi.obj
  maskApi.c
  c1: fatal error C1083: 無法打開源文件: “../common/maskApi.c”: No such file or directory
  error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\VC\\Tools\\MSVC\\14.20.27508\\bin\\HostX86\\x64\\cl.exe' failed with exit code 2
  ----------------------------------------
  ERROR: Failed building wheel for pycocotools-win
  Running setup.py clean for pycocotools-win
Failed to build pycocotools-win
Installing collected packages: pycocotools-win
    Running setup.py install for pycocotools-win ... error
    ERROR: Command errored out with exit status 1:
     command: 'D:\Anaconda\anaconda\envs\pytorch1.10.1\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'D:\\temp\\pip-install-48raidr9\\pycocotools-win_9d4ff4791ad241a99d6dd3ac703b0b51\\setup.py'"'"'; __file__='"'"'D:\\temp\\pip-insta
ll-48raidr9\\pycocotools-win_9d4ff4791ad241a99d6dd3ac703b0b51\\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"',
'"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'D:\temp\pip-record-v9coqsh6\install-record.txt' --single-version-externally-managed --compile --install-headers 'D:\Anaconda\anaconda\envs\pytorch1.10.1\Include\pycocotools-win
'
         cwd: D:\temp\pip-install-48raidr9\pycocotools-win_9d4ff4791ad241a99d6dd3ac703b0b51\
    Complete output (23 lines):
    running install
    D:\Anaconda\anaconda\envs\pytorch1.10.1\lib\site-packages\setuptools\command\install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
      warnings.warn(
    running build
    running build_py
    creating build
    creating build\lib.win-amd64-3.9
    creating build\lib.win-amd64-3.9\pycocotools
    copying pycocotools\coco.py -> build\lib.win-amd64-3.9\pycocotools
    copying pycocotools\cocoeval.py -> build\lib.win-amd64-3.9\pycocotools
    copying pycocotools\mask.py -> build\lib.win-amd64-3.9\pycocotools
    copying pycocotools\__init__.py -> build\lib.win-amd64-3.9\pycocotools
    running build_ext
    skipping 'pycocotools\_mask.c' Cython extension (up-to-date)
    building 'pycocotools._mask' extension
    creating build\temp.win-amd64-3.9
    creating build\temp.win-amd64-3.9\common
    creating build\temp.win-amd64-3.9\Release
    creating build\temp.win-amd64-3.9\Release\pycocotools
    "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.20.27508\bin\HostX86\x64\cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD -ID:\Anaconda\anaconda\envs\pytorch1.10.1\lib\site-packages\numpy\core\include -I../common -ID:\Anaconda\anacon
da\envs\pytorch1.10.1\include -ID:\Anaconda\anaconda\envs\pytorch1.10.1\Include "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.20.27508\ATLMFC\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MS
VC\14.20.27508\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\um" "-IC:\Program Files (x86)\Windows
Kits\10\include\10.0.17763.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\cppwinrt" /Tc../common/maskApi.c /Fobuild\temp.win-amd64-3.9\Release\../common/maskApi.obj
    maskApi.c
    c1: fatal error C1083: 無法打開源文件: “../common/maskApi.c”: No such file or directory
    error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\VC\\Tools\\MSVC\\14.20.27508\\bin\\HostX86\\x64\\cl.exe' failed with exit code 2
    ----------------------------------------
ERROR: Command errored out with exit status 1: 'D:\Anaconda\anaconda\envs\pytorch1.10.1\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'D:\\temp\\pip-install-48raidr9\\pycocotools-win_9d4ff4791ad241a99d6dd3ac703b0b51\\setup.py'"'"';
__file__='"'"'D:\\temp\\pip-install-48raidr9\\pycocotools-win_9d4ff4791ad241a99d6dd3ac703b0b51\\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code =
f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'D:\temp\pip-record-v9coqsh6\install-record.txt' --single-version-externally-managed --compile --install-headers 'D:\Anaconda\anaconda\envs\pyto
rch1.10.1\Include\pycocotools-win' Check the logs for full command output.

解決方法1(親測有效):

conda install -c conda-forge pycocotools

用conda裝一下就好了,并且速度也快!

解決方法2(未親測):

conda install pycocotools -c Esri

解決方案三:

直接把這個包下載下來放到你anaconda虛擬環(huán)境所在的目錄下中的site-packages文件夾內(nèi)

pycococtools的安裝包 pycocotools 提取碼: p691 

下載解壓后得到兩個文件,將以上兩個文件夾復(fù)制至你anaconda虛擬環(huán)境所在的目錄下中的site-packages文件夾內(nèi) [1]

如博主的目錄為:

D:\Anaconda\ana\Lib\site-packages 

參考資料:

Windows10安裝pycocotools報錯的一些解決方法

到此這篇關(guān)于Windows安裝pycocotools的實現(xiàn)示例的文章就介紹到這了,更多相關(guān)Windows安裝pycocotools內(nèi)容請搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!

相關(guān)文章

  • Pycharm Plugins加載失敗問題解決方案

    Pycharm Plugins加載失敗問題解決方案

    這篇文章主要介紹了Pycharm Plugins加載失敗問題解決方案,文中通過示例代碼介紹的非常詳細,對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價值,需要的朋友可以參考下
    2020-11-11
  • Python中使用Selenium環(huán)境安裝的方法步驟

    Python中使用Selenium環(huán)境安裝的方法步驟

    這篇文章主要介紹了Python中使用Selenium環(huán)境安裝的方法步驟,文中通過示例代碼介紹的非常詳細,對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧
    2021-02-02
  • python關(guān)閉占用端口方式

    python關(guān)閉占用端口方式

    今天小編就為大家分享一篇python關(guān)閉占用端口方式,具有很好的參考價值,希望對大家有所幫助。一起跟隨小編過來看看吧
    2019-12-12
  • Python使用multiprocessing.Queue進行進程間通信

    Python使用multiprocessing.Queue進行進程間通信

    本文主要介紹了Python使用multiprocessing.Queue進行進程間通信,文中通過示例代碼介紹的非常詳細,對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧
    2025-02-02
  • python面試題Python2.x和Python3.x的區(qū)別

    python面試題Python2.x和Python3.x的區(qū)別

    這篇文章主要介紹了python面試題Python2.x和Python3.x的區(qū)別 ,在面試中也經(jīng)常會問到,本文給大家介紹的非常詳細,具有一定的參考借鑒價值,需要的朋友可以參考下
    2019-05-05
  • Python圖像處理之簡單畫板實現(xiàn)方法示例

    Python圖像處理之簡單畫板實現(xiàn)方法示例

    這篇文章主要介紹了Python圖像處理之簡單畫板實現(xiàn)方法,結(jié)合實例形式分析了Python基于cv2模塊與numpy模塊的數(shù)值計算及矩形圖形繪制簡單操作技巧,需要的朋友可以參考下
    2018-08-08
  • 深入解析PYTHON?虛擬機令人拍案叫絕的字節(jié)碼設(shè)計

    深入解析PYTHON?虛擬機令人拍案叫絕的字節(jié)碼設(shè)計

    這篇文章主要為大家介紹了PYTHON虛擬機中令人拍案叫絕的字節(jié)碼設(shè)計深入詳解,有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進步,早日升職加薪
    2023-04-04
  • tensorflow 重置/清除計算圖的實現(xiàn)

    tensorflow 重置/清除計算圖的實現(xiàn)

    今天小編就為大家分享一篇tensorflow 重置/清除計算圖的實現(xiàn),具有很好的參考價值,希望對大家有所幫助。一起跟隨小編過來看看吧
    2020-01-01
  • 詳解python中的文件與目錄操作

    詳解python中的文件與目錄操作

    這篇文章主要介紹了詳解python中的文件與目錄操作的相關(guān)資料,需要的朋友可以參考下
    2017-07-07
  • 利用Python實現(xiàn)每日新聞推送

    利用Python實現(xiàn)每日新聞推送

    這篇文章主要為大家詳細介紹了如何使用Python編寫簡單的邏輯,通過調(diào)用API接口實現(xiàn)每日新聞推送功能,感興趣的小伙伴可以跟隨小編一起學(xué)習(xí)一下
    2023-06-06

最新評論

桂东县| 阿尔山市| 虹口区| 红安县| 东明县| 天峨县| 简阳市| 张家界市| 柞水县| 长岛县| 黔西| 类乌齐县| 灯塔市| 富顺县| 石楼县| 堆龙德庆县| 东乌珠穆沁旗| 鞍山市| 三穗县| 邢台市| 固阳县| 东莞市| 克拉玛依市| 瓦房店市| 万山特区| 垣曲县| 建昌县| 嵊泗县| 道真| 海城市| 那曲县| 克什克腾旗| 龙州县| 邻水| 韶关市| 浮梁县| 万全县| 石屏县| 迭部县| 武胜县| 镇赉县|