You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
I am running the handtracker code you put in the lesson but i am getting below error:
Traceback (most recent call last):
File "E:/Alqadib/VirtuaLab/comp vision/main.py", line 1, in
from cvzone.HandTrackingModule import HandDetector
File "C:\Users\zeesh\AppData\Local\Programs\Python\Python39\lib\site-packages\cvzone\HandTrackingModule.py", line 10, in
import mediapipe as mp
ModuleNotFoundError: No module named 'mediapipe'
below is the code in case you wanna see, even tgough i installed it using: pip3 install mediapipe --user
while True:
# Get image frame
success, img = cap.read()
# Find the hand and its landmarks
hands, img = detector.findHands(img) # with draw
# hands = detector.findHands(img, draw=False) # without draw
data = []
if hands:
# Hand 1
hand = hands[0]
lmList = hand["lmList"] # List of 21 Landmark points
for lm in lmList:
data.extend([lm[0], h - lm[1], lm[2]])
sock.sendto(str.encode(str(data)), serverAddressPort)
# Display
cv2.imshow("Image", img)
cv2.waitKey(1)
It seems that this package doesn't list mediapipe in its dependencies, so you have to pip install mediapipe manually, right.
If you're still getting the ModuleImportError, as you wrote, check if you're using pip from the correct interpreter when installing mediapipe with pip -V (see the "from" part of the output).
Activity
iburakov commentedon Mar 10, 2024
It seems that this package doesn't list
mediapipein its dependencies, so you have topip install mediapipemanually, right.If you're still getting the
ModuleImportError, as you wrote, check if you're using pip from the correct interpreter when installingmediapipewithpip -V(see the "from" part of the output).Relevant: https://stackoverflow.com/questions/78135691/