Skip to content

[bug]: ImportError: DLL load failed while importing cv2: The specified module could not be found. #5204

Closed
@pidtuner

Description

@pidtuner

Is there an existing issue for this?

  • I have searched the existing issues

OS

Windows

GPU

cuda

VRAM

4GB

What version did you experience this issue on?

3.4.0post2

What happened?

Try to run and get greeted by:

ImportError: DLL load failed while importing cv2: The specified module could not be found.

I have updated Nvidia drivers, installed CUDA SDK, and no luck. Also tried a few commands from the internet, yet cannot seem to move on

This is the output, thanks in advance for any help:

Loading...
WARNING[XFORMERS]: xFormers can't load C++/CUDA extensions. xFormers was built for:
    PyTorch 2.1.0+cu121 with CUDA 1201 (you have 2.0.0+cu118)
    Python  3.10.11 (you have 3.10.12)
  Please reinstall xformers (see https://github.com/facebookresearch/xformers#installing-xformers)
  Memory-efficient attention, SwiGLU, sparse and more won't be available.
  Set XFORMERS_MORE_DETAILS=1 for more details
A matching Triton is not available, some optimizations will not be enabled.
Error caught was: No module named 'triton'
[2023-11-30 13:18:30,577]::[InvokeAI]::INFO --> Loaded 0 modules from D:\DownloadsDevelopment\invokeai3_standalone\invokeai\nodes
Traceback (most recent call last):
  File "D:\DownloadsDevelopment\invokeai3_standalone\env\lib\runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "D:\DownloadsDevelopment\invokeai3_standalone\env\lib\runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "D:\DownloadsDevelopment\invokeai3_standalone\env\Scripts\invokeai-web.exe\__main__.py", line 4, in <module>
  File "D:\DownloadsDevelopment\invokeai3_standalone\env\lib\site-packages\invokeai\app\api_app.py", line 40, in <module>
    from .api.dependencies import ApiDependencies
  File "D:\DownloadsDevelopment\invokeai3_standalone\env\lib\site-packages\invokeai\app\api\dependencies.py", line 10, in <module>
    from ..services.board_images.board_images_default import BoardImagesService
  File "D:\DownloadsDevelopment\invokeai3_standalone\env\lib\site-packages\invokeai\app\services\board_images\board_images_default.py", line 3, in <module>
    from invokeai.app.services.invoker import Invoker
  File "D:\DownloadsDevelopment\invokeai3_standalone\env\lib\site-packages\invokeai\app\services\invoker.py", line 7, in <module>
    from .shared.graph import Graph, GraphExecutionState
  File "D:\DownloadsDevelopment\invokeai3_standalone\env\lib\site-packages\invokeai\app\services\shared\graph.py", line 12, in <module>
    from invokeai.app.invocations import *  # noqa: F401 F403
  File "D:\DownloadsDevelopment\invokeai3_standalone\env\lib\site-packages\invokeai\app\invocations\controlnet_image_processors.py", line 7, in <module>
    import cv2
  File "D:\DownloadsDevelopment\invokeai3_standalone\env\lib\site-packages\cv2\__init__.py", line 181, in <module>
    bootstrap()
  File "D:\DownloadsDevelopment\invokeai3_standalone\env\lib\site-packages\cv2\__init__.py", line 153, in bootstrap
    native_module = importlib.import_module("cv2")
  File "D:\DownloadsDevelopment\invokeai3_standalone\env\lib\importlib\__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
ImportError: DLL load failed while importing cv2: The specified module could not be found.
Press any key to continue . . .

Screenshots

image

Additional context

No response

Contact Details

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions