# Hand Tracking Mediapipe tutorial on rPi4

**URL:** <https://forum.core-electronics.com.au/t/hand-tracking-mediapipe-tutorial-on-rpi4/12574>\
**Category:** Raspberry Pi\
**Created:** [25 December 2021 22:06 UTC](https://forum.core-electronics.com.au/t/hand-tracking-mediapipe-tutorial-on-rpi4/12574 "2021-12-25T22:06:55Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Stephen188341](https://avatars.discourse-cdn.com/v4/letter/s/eb9ed0/32.png) [@Stephen188341](https://forum.core-electronics.com.au/u/Stephen188341)\
**Post date:** [25 December 2021 22:06 UTC](https://forum.core-electronics.com.au/t/hand-tracking-mediapipe-tutorial-on-rpi4/12574/1 "2021-12-25T22:06:55Z")

</div>

I have installed the Hand Tracking code with mediapipe and all dependencies as per your instructions on

> **[Hand Recognition and Finger Identification with Raspberry Pi and OpenCV -...](https://core-electronics.com.au/tutorials/raspberry-pi/hand-identification-raspberry-pi.html)**
>
> \[Update – Until there is correct compatibility of OPEN-CV with the new Raspberry Pi ‘Bullseye’ OS I highly recommend at this stage flashing and using the previous Raspberry Pi ‘Buster’ OS onto your Micro-SD for use with this guide...

but got this inscrutable error, in case you can help:

pi@raspberrypi:~/Desktop $ python3 Pose.py  
RuntimeError: module compiled against API version 0xe but this version of numpy is 0xd  
Traceback (most recent call last):  
File “Pose.py”, line 2, in   
import mediapipe as mp  
File “/usr/local/lib/python3.7/dist-packages/mediapipe/ **init**.py”, line 17, in   
import mediapipe.python.solutions as solutions  
File “/usr/local/lib/python3.7/dist-packages/mediapipe/python/solutions/ **init**.py”, line 17, in   
import mediapipe.python.solutions.drawing\_styles  
File “/usr/local/lib/python3.7/dist-packages/mediapipe/python/solutions/drawing\_styles.py”, line 20, in   
from mediapipe.python.solutions.drawing\_utils import DrawingSpec  
File “/usr/local/lib/python3.7/dist-packages/mediapipe/python/solutions/drawing\_utils.py”, line 22, in   
import matplotlib.pyplot as plt  
File “/usr/local/lib/python3.7/dist-packages/matplotlib/ **init**.py”, line 109, in   
from . import \_api, \_version, cbook, docstring, rcsetup  
File “/usr/local/lib/python3.7/dist-packages/matplotlib/rcsetup.py”, line 27, in   
from matplotlib.colors import Colormap, is\_color\_like  
File “/usr/local/lib/python3.7/dist-packages/matplotlib/colors.py”, line 56, in   
from matplotlib import \_api, cbook, scale  
File “/usr/local/lib/python3.7/dist-packages/matplotlib/scale.py”, line 23, in   
from matplotlib.ticker import (  
File “/usr/local/lib/python3.7/dist-packages/matplotlib/ticker.py”, line 136, in   
from matplotlib import transforms as mtransforms  
File “/usr/local/lib/python3.7/dist-packages/matplotlib/transforms.py”, line 46, in   
from matplotlib.\_path import (  
ImportError: numpy.core.multiarray failed to import

---

<div class="post-metadata">

**Author:** ![Oliver](https://yyz2.discourse-cdn.com/flex028/user_avatar/forum.core-electronics.com.au/oliver/32/3315_2.png) [@Oliver](https://forum.core-electronics.com.au/u/Oliver)\
**Post date:** [30 December 2021 06:06 UTC](https://forum.core-electronics.com.au/t/hand-tracking-mediapipe-tutorial-on-rpi4/12574/2 "2021-12-30T06:06:39Z")

</div>

> [@Stephen188341](#):
>
> module compiled against API version 0xe but this version of numpy is 0xd

Hey Stephen, I think this is your big clue - 0xd \< 0xe. ie., you need to update numpy: `pip3 install numpy --upgrade`

---

<div class="post-metadata">

**Author:** ![Stephen188341](https://avatars.discourse-cdn.com/v4/letter/s/eb9ed0/32.png) [@Stephen188341](https://forum.core-electronics.com.au/u/Stephen188341)\
**Post date:** [30 December 2021 13:58 UTC](https://forum.core-electronics.com.au/t/hand-tracking-mediapipe-tutorial-on-rpi4/12574/3 "2021-12-30T13:58:18Z")

</div>

Thanks, will try. Looking for a hand tracking solution that might work on Jetson Nano (or rpi4) or other SBC. Would hire a consultant gladly. For user acceptance, I really need 25 fps or better.

---

<div class="post-metadata">

**Author:** ![Oliver](https://yyz2.discourse-cdn.com/flex028/user_avatar/forum.core-electronics.com.au/oliver/32/3315_2.png) [@Oliver](https://forum.core-electronics.com.au/u/Oliver)\
**Post date:** [31 December 2021 00:54 UTC](https://forum.core-electronics.com.au/t/hand-tracking-mediapipe-tutorial-on-rpi4/12574/4 "2021-12-31T00:54:38Z")

</div>

If it’s for a commercial application, it might be worth getting in touch with someone like Saphi:

> **[SAPHI is Software And Programmable Hardware Integration](https://saphi.engineering/)**
>
> SAPHI is Software and Programmable Hardware IntegrationAt SAPHI we are a team who are passionate about creating smarter robotic solutions for our clients. Our engineers have the expertise to design and implement smarter and more efficient systems for...

---

<div class="post-metadata">

**Author:** ![Stephen188341](https://avatars.discourse-cdn.com/v4/letter/s/eb9ed0/32.png) [@Stephen188341](https://forum.core-electronics.com.au/u/Stephen188341)\
**Post date:** [31 December 2021 01:41 UTC](https://forum.core-electronics.com.au/t/hand-tracking-mediapipe-tutorial-on-rpi4/12574/5 "2021-12-31T01:41:07Z")

</div>

Thanks for the lead.

---

<div class="post-metadata">

**Author:** ![Oliver](https://yyz2.discourse-cdn.com/flex028/user_avatar/forum.core-electronics.com.au/oliver/32/3315_2.png) [@Oliver](https://forum.core-electronics.com.au/u/Oliver)\
**Post date:** [31 December 2021 01:42 UTC](https://forum.core-electronics.com.au/t/hand-tracking-mediapipe-tutorial-on-rpi4/12574/6 "2021-12-31T01:42:46Z")

</div>

No worries 🙂

---

<div class="post-metadata">

**Author:** ![Stephen188341](https://avatars.discourse-cdn.com/v4/letter/s/eb9ed0/32.png) [@Stephen188341](https://forum.core-electronics.com.au/u/Stephen188341)\
**Post date:** [31 December 2021 02:11 UTC](https://forum.core-electronics.com.au/t/hand-tracking-mediapipe-tutorial-on-rpi4/12574/7 "2021-12-31T02:11:49Z")

</div>

How many frames per second were you able to get with your Raspberry Pi hand tracker? Suitable for control of cursor movement or a bit too slow?

---

<div class="post-metadata">

**Author:** ![MuhammadAtique200356](https://avatars.discourse-cdn.com/v4/letter/m/ed8c4c/32.png) [@MuhammadAtique200356](https://forum.core-electronics.com.au/u/MuhammadAtique200356)\
**Post date:** [30 April 2022 11:25 UTC](https://forum.core-electronics.com.au/t/hand-tracking-mediapipe-tutorial-on-rpi4/12574/8 "2022-04-30T11:25:12Z")

</div>

@Stephen188341 Have you found a solution? if not then I can help you with this.

---

<div class="post-metadata">

**Author:** ![Harry272782](https://avatars.discourse-cdn.com/v4/letter/h/eada6e/32.png) [@Harry272782](https://forum.core-electronics.com.au/u/Harry272782)\
**Post date:** [4 June 2024 00:47 UTC](https://forum.core-electronics.com.au/t/hand-tracking-mediapipe-tutorial-on-rpi4/12574/9 "2024-06-04T00:47:35Z")

</div>

Hi, I am getting the following error too:

```auto
make[2]: *** [modules/videoio/CMakeFiles/opencv_videoio.dir/build.make:216: modules/videoio/CMakeFiles/opencv_videoio.dir/src/cap_ffmpeg.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:7904: modules/videoio/CMakeFiles/opencv_videoio.dir/all] Error 2
make: *** [Makefile:166: all] Error 2

```

Ive enter the below command multiple times, and while at first it was progressing… now its just repeating the same error

```auto
make -j $(nproc)

```

---

<div class="post-metadata">

**Author:** ![Michael](https://yyz2.discourse-cdn.com/flex028/user_avatar/forum.core-electronics.com.au/michael/32/3545_2.png) [@Michael](https://forum.core-electronics.com.au/u/Michael)\
**Post date:** [4 June 2024 06:11 UTC](https://forum.core-electronics.com.au/t/hand-tracking-mediapipe-tutorial-on-rpi4/12574/10 "2024-06-04T06:11:27Z")

</div>

Hi @Harry272782 - are you using the correct OS version as recommended during the guide? That might be a good point to start if not.

Historically, computer vision and ML projects have been tricky on Pi, and it may be that certain packages have been updated and become incompatible.

It might be worth seeking out the latest guidance from the maintainer of the `mediapipe` package.
