google-ai-edge / mediapipe

Cross-platform, customizable ML solutions for live and streaming media.
https://ai.google.dev/edge/mediapipe
Apache License 2.0
26.82k stars 5.09k forks source link

DLL load failed while importing _framework_bindings: The specified module could not be found. #1905

Closed Kartikeyajhalani closed 3 years ago

Kartikeyajhalani commented 3 years ago

Hi I ran into an DLL Error while running a simple code snippet

import mediapipe
print("Package Imported")

This is my error

"C:\Users\<myusername>\AppData\Local\Programs\Python\Python39\python.exe" "C:/Users/<myusername>/Documents/PyCharm Projects/HandRecognition/HandTrackingModule.py"
Traceback (most recent call last):
  File "C:\Users\<myusername>\Documents\PyCharm Projects\HandRecognition\HandTrackingModule.py", line 1, in <module>
    import mediapipe
  File "C:\Users\<myusername>\AppData\Local\Programs\Python\Python39\lib\site-packages\mediapipe\__init__.py", line 16, in <module>
    from mediapipe.python import *
  File "C:\Users\<myusername>\AppData\Local\Programs\Python\Python39\lib\site-packages\mediapipe\python\__init__.py", line 17, in <module>
    from mediapipe.python._framework_bindings import resource_util
ImportError: DLL load failed while importing _framework_bindings: The specified module could not be found.

Process finished with exit code 1

My System details:

sgowroji commented 3 years ago

Hi @Kartikeyajhalani, Have a look at this https://github.com/google/mediapipe/issues/1839#issuecomment-817253475.

Kartikeyajhalani commented 3 years ago

Thank you very much it helped me.

sgowroji commented 3 years ago

We are glad to know your resolved with above comment. Thank you for the update.

shaheen14git commented 2 years ago

Hey! I'm also having the same problem as @Kartikeyajhalani but unfortuately #1839(comment) didn't work for me. System Details:

Traceback (most recent call last): File "C:/Users/username/PycharmProjects/python-project/TrackingModule.py", line 2, in import mediapipe as mp File "C:\Users\username\PycharmProjects\python-project\venv\lib\site-packages\mediapipe__init.py", line 16, in from mediapipe.python import * File "C:\Users\username\PycharmProjects\python-project\venv\lib\site-packages\mediapipe\python\init__.py", line 17, in from mediapipe.python._framework_bindings import resource_util ImportError: DLL load failed while importing _framework_bindings: The specified module could not be found.

Process finished with exit code 1

Kartikeyajhalani commented 2 years ago

Try running this, it might help pip install msvc-runtime

shaheen14git commented 2 years ago

Thanks for your response, but unfortunately this didn't work for me. The same error is still persisting

Kartikeyajhalani commented 2 years ago

How did you installed the module via pip or by searching it in packages and then installing it?

shaheen14git commented 2 years ago

via pip. ie. pip install mediapipe

Kartikeyajhalani commented 2 years ago

Then try this and tell me if the problem persists.

  1. open command prompt or powershell (whatever you use).
  2. run pip install mediapipe
  3. run python
  4. then import mediapipe

This will tell us that the the problem is virtual environment or your system.

shaheen14git commented 2 years ago

Thanks for your support. I tried whatever you said . Looks like problem is with system only.

C:\Users\Shaheen>pip install mediapipe Requirement already satisfied: mediapipe in c:\users\shaheen\appdata\local\programs\python\python38\lib\site-packages (0.8.9) Requirement already satisfied: attrs>=19.1.0 in c:\users\shaheen\appdata\local\programs\python\python38\lib\site-packages (from mediapipe) (21.2.0) Requirement already satisfied: numpy in c:\users\shaheen\appdata\local\programs\python\python38\lib\site-packages (from mediapipe) (1.21.4) Requirement already satisfied: wheel in c:\users\shaheen\appdata\local\programs\python\python38\lib\site-packages (from mediapipe) (0.37.0) Requirement already satisfied: absl-py in c:\users\shaheen\appdata\local\programs\python\python38\lib\site-packages (from mediapipe) (0.15.0) Requirement already satisfied: opencv-contrib-python in c:\users\shaheen\appdata\local\programs\python\python38\lib\site-packages (from mediapipe) (4.5.4.58) Requirement already satisfied: six in c:\users\shaheen\appdata\local\programs\python\python38\lib\site-packages (from mediapipe) (1.16.0) Requirement already satisfied: protobuf>=3.11.4 in c:\users\shaheen\appdata\local\programs\python\python38\lib\site-packages (from mediapipe) (3.19.1) Requirement already satisfied: matplotlib in c:\users\shaheen\appdata\local\programs\python\python38\lib\site-packages (from mediapipe) (3.4.3) Requirement already satisfied: kiwisolver>=1.0.1 in c:\users\shaheen\appdata\local\programs\python\python38\lib\site-packages (from matplotlib->mediapipe) (1.3.2) Requirement already satisfied: cycler>=0.10 in c:\users\shaheen\appdata\local\programs\python\python38\lib\site-packages (from matplotlib->mediapipe) (0.11.0) Requirement already satisfied: pyparsing>=2.2.1 in c:\users\shaheen\appdata\local\programs\python\python38\lib\site-packages (from matplotlib->mediapipe) (3.0.4) Requirement already satisfied: python-dateutil>=2.7 in c:\users\shaheen\appdata\local\programs\python\python38\lib\site-packages (from matplotlib->mediapipe) (2.8.2) Requirement already satisfied: pillow>=6.2.0 in c:\users\shaheen\appdata\local\programs\python\python38\lib\site-packages (from matplotlib->mediapipe) (8.4.0) WARNING: You are using pip version 20.2.3; however, version 21.3.1 is available. You should consider upgrading via the 'c:\users\shaheen\appdata\local\programs\python\python38\python.exe -m pip install --upgrade pip' command.

C:\Users\Shaheen>python Python 3.8.9 (tags/v3.8.9:a743f81, Apr 6 2021, 14:02:34) [MSC v.1928 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information.

import mediapipe Traceback (most recent call last): File "", line 1, in File "C:\Users\Shaheen\AppData\Local\Programs\Python\Python38\lib\site-packages\mediapipe__init.py", line 16, in from mediapipe.python import * File "C:\Users\Shaheen\AppData\Local\Programs\Python\Python38\lib\site-packages\mediapipe\python\init__.py", line 17, in from mediapipe.python._framework_bindings import resource_util ImportError: DLL load failed while importing _framework_bindings: The specified module could not be found.

On Sun, Nov 7, 2021 at 10:32 AM Kartikeyajhalani @.***> wrote:

Then try this and tell me if the problem persists.

  1. open command prompt or powershell (whatever you use).
  2. run pip install mediapipe
  3. run python
  4. then import mediapipe

This will tell us that the the problem is virtual environment or your system.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/google/mediapipe/issues/1905#issuecomment-962552574, or unsubscribe https://github.com/notifications/unsubscribe-auth/AWITJ7YHKGHEME2CKTBGWKLUKYB57ANCNFSM43FOIFPA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

Kartikeyajhalani commented 2 years ago

Well, that's all I know. I lastly recommend downloading and installing vc redist on your system.

Taha-Khadim commented 2 years ago

pip install msvc-runtime

This thing solved my issue _framework_bindings module not found.