[Python] Running labelme in VS Code terminal gets ImportError: DLL load failed while importing...

Discussão em 'Python' iniciado por Stack, Julho 17, 2025.

  1. Stack

    Stack Membro Participativo

    I'm following along with this YouTube video.

    I've already run the command

    pip install labelme opencv-python tensorflow matplotlib albumentations


    in the VS Code powershell terminal and successfully ran the code to capture images for labelling. However, when I try to run the command labelme, I get the error

    Traceback (most recent call last):
    File "<frozen runpy>", line 198, in _run_module_as_main
    File "<frozen runpy>", line 88, in _run_code
    File "C:\Users\Otaku\AppData\Local\Programs\Python\Python312\Scripts\labelme.exe\__main__.py", line 4, in <module>
    File "C:\Users\Otaku\AppData\Local\Programs\Python\Python312\Lib\site-packages\labelme\__main__.py", line 17, in <module>
    from labelme.app import MainWindow
    File "C:\Users\Otaku\AppData\Local\Programs\Python\Python312\Lib\site-packages\labelme\app.py", line 21, in <module>
    from labelme._automation import bbox_from_text
    File "C:\Users\Otaku\AppData\Local\Programs\Python\Python312\Lib\site-packages\labelme\_automation\bbox_from_text.py", line 6, in <module>
    import osam
    File "C:\Users\Otaku\AppData\Local\Programs\Python\Python312\Lib\site-packages\osam\__init__.py", line 5, in <module>
    from . import apis # noqa: F401
    ^^^^^^^^^^^^^^^^^^
    File "C:\Users\Otaku\AppData\Local\Programs\Python\Python312\Lib\site-packages\osam\apis.py", line 5, in <module>
    import onnxruntime
    File "C:\Users\Otaku\AppData\Local\Programs\Python\Python312\Lib\site-packages\onnxruntime\__init__.py", line 61, in <module>
    raise import_capi_exception
    File "C:\Users\Otaku\AppData\Local\Programs\Python\Python312\Lib\site-packages\onnxruntime\__init__.py", line 24, in <module>
    from onnxruntime.capi._pybind_state import (
    File "C:\Users\Otaku\AppData\Local\Programs\Python\Python312\Lib\site-packages\onnxruntime\capi\_pybind_state.py", line 32, in <module>
    from .onnxruntime_pybind11_state import * # noqa
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    ImportError: DLL load failed while importing onnxruntime_pybind11_state: A dynamic link library (DLL) initialization routine failed.


    Uninstalling and reinstalling with pip didn't fix it.

    Python is version 3.12.10 (64-bit), pip/VS Code/Windows are up-to-date.

    How do I fix this?

    Continue reading...

Compartilhe esta Página