Skip to content

DLL load failed on Windows when importing mediapipe after PyQt6 #6029

Description

@eric15342335

Have I written custom code (as opposed to using a stock example script provided in MediaPipe)

Yes

OS Platform and Distribution

GitHub Actions windows-2022 windows-2025

Mobile device if the issue happens on mobile device

No response

Browser and version if the issue happens on browser

No response

Programming Language and version

Python 3.9, 3.10, 3.11, 3.12

MediaPipe version

0.10.11

Bazel version

No response

Solution

N/A

Android Studio, NDK, SDK versions (if issue is related to building in Android environment)

No response

Xcode & Tulsi version (if issue is related to building for iOS)

No response

Describe the actual behavior

On Windows, importing the mediapipe module fails with a DLL error if PyQt6 has been imported first. The process terminates with an ImportError.

Describe the expected behaviour

The mediapipe module is expected to import successfully, regardless of whether other packages, such as PyQt6, have been previously imported.

Standalone code/steps you may have used to try to get what you need

Repository: https://github.com/eric15342335/mediapipe-pyqt6-import-test
Failed workflow run: https://github.com/eric15342335/mediapipe-pyqt6-import-test/actions/runs/16015407753
Code: https://github.com/eric15342335/mediapipe-pyqt6-import-test/blob/main/test_import_conflict.py
Workflow file: https://github.com/eric15342335/mediapipe-pyqt6-import-test/tree/main/.github/workflows

import PyQt6
import mediapipe

Other info / Complete Logs

Traceback (most recent call last):
  File "D:\a\mediapipe-pyqt6-import-test\mediapipe-pyqt6-import-test\test_import_conflict.py", line 37, in test_imports
    import mediapipe as mp
  File "C:\hostedtoolcache\windows\Python\3.12.10\x64\Lib\site-packages\mediapipe\__init__.py", line 15, in <module>
    from mediapipe.python import *
  File "C:\hostedtoolcache\windows\Python\3.12.10\x64\Lib\site-packages\mediapipe\python\__init__.py", line 17, in <module>
    from mediapipe.python._framework_bindings import model_ckpt_util
ImportError: DLL load failed while importing _framework_bindings: A dynamic link library (DLL) initialization routine failed.

Metadata

Metadata

Assignees

Labels

os:windowsMediaPipe issues on Windowsplatform:pythonMediaPipe Python issuestask::allAll tasks of MediaPipetype:bugBug in the Source Code of MediaPipe Solution

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions