3

I import opencv And mediapipe then add code to display image.

import cv2

import mediapipe as mp

import time

cap = cv2.VideoCapture(1)

while True:

    success, img = cap.read()

    cv2.imshow("image",img)

    cv2.waitKey(1)

It show me this error............... plz help me if any developer know this error

D:\pythonProject\handTracksecnond\venv\Scripts\python.exe D:/pythonProject/handTracksecnond/handTrackingMin.py
    Traceback (most recent call last):
      File "D:/pythonProject/handTracksecnond/handTrackingMin.py", line 2, in <module>
        import mediapipe as mp
      File "D:\pythonProject\handTracksecnond\venv\lib\site-packages\mediapipe\__init__.py", line 16, in <module>
        import mediapipe.python
      File "D:\pythonProject\handTracksecnond\venv\lib\site-packages\mediapipe\python\__init__.py", line 17, in <module>
        from ._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
M.Shahzad
  • 106
  • 10

1 Answers1

2


It looks like there was an error when you installed the module mediapipe. I would suggest trying to reinstall the module using

pip uninstall mediapipe
pip install mediapipe

Some people solved the issue by doing

pip install msvc-runtime

I hope this was helpful

LiteApplication
  • 177
  • 2
  • 13
  • it show me this error [ WARN:0] global C:\Users\runneradmin\AppData\Local\Temp\pip-req-build-kuwfz3h3\opencv\modules\videoio\src\cap_msmf.cpp (438) `anonymous-namespace'::SourceReaderCB::~SourceReaderCB terminating async callback Traceback (most recent call last): File "D:/pythonProject/handTracksecnond/handTrackingMin.py", line 12, in cv2.imshow("image",img) cv2.error: OpenCV(4.5.2) C:\Users\runneradmin\AppData\Local\Temp\pip-req-build-kuwfz3h3\opencv\modules\highgui\src\window.cpp:404: error: (-215:Assertion failed) size.width>0 && size.height>0 in function 'cv::imshow' – M.Shahzad May 30 '21 at 16:44
  • 1
    thank you sir I add this code------ captureDevice = cv2.VideoCapture(0, cv2.CAP_DSHOW) #captureDevice = camera and also download visual c++ it solve my issue. thank you sir God bless you – M.Shahzad May 30 '21 at 16:53
  • Don't forget to mark this question as solved if your problem is fixed – LiteApplication Jul 26 '21 at 07:58
  • thank you sir for your help . dont for get to Vot.e my quesiotion to – M.Shahzad Dec 01 '22 at 06:52