I expected to use face_recognition 32-bit Raspberry PI 4, but found this issue.

pi@raspberrypi:~ $ pip3 install face_recognition
Defaulting to user installation because normal site-packages is not writeable
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Requirement already satisfied: face_recognition in ./.local/lib/python3.9/site-packages (1.3.0)
Requirement already satisfied: face-recognition-models>=0.3.0 in ./.local/lib/python3.9/site-packages (from face_recognition) (0.3.0)
Requirement already satisfied: Click>=6.0 in ./.local/lib/python3.9/site-packages (from face_recognition) (8.1.7)
Requirement already satisfied: dlib>=19.7 in ./.local/lib/python3.9/site-packages (from face_recognition) (19.24.2)
Requirement already satisfied: numpy in ./.local/lib/python3.9/site-packages (from face_recognition) (1.26.4)
Requirement already satisfied: Pillow in ./.local/lib/python3.9/site-packages (from face_recognition) (10.2.0)
pi@raspberrypi:~ $ python3 
Python 3.9.0 (default, Feb 13 2024, 22:18:52) 
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import face_recognition
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/pi/.local/lib/python3.9/site-packages/face_recognition/__init__.py", line 7, in <module>
    from .api import load_image_file, face_locations, batch_face_locations, face_landmarks, face_encodings, compare_faces, face_distance
  File "/home/pi/.local/lib/python3.9/site-packages/face_recognition/api.py", line 3, in <module>
    import PIL.Image
  File "/home/pi/.local/lib/python3.9/site-packages/PIL/Image.py", line 84, in <module>
    from . import _imaging as core
ImportError: /home/pi/.local/lib/python3.9/site-packages/PIL/_imaging.cpython-39-arm-linux-gnueabihf.so: undefined symbol: opj_encoder_set_extra_options

My Raspberry PI model is as follows:

Hardware    : BCM2835
Revision    : d03114
Serial      : 10000000973ffc25
Model       : Raspberry Pi 4 Model B Rev 1.4

The version of Python I'm running: python3.9.0

I tried uninstalling Pillow and reinstalling it, but it still failed

pi@raspberrypi:~ $ pip3 uninstall Pillow
Found existing installation: pillow 10.2.0
Uninstalling pillow-10.2.0:
  Would remove:
    /home/pi/.local/lib/python3.9/site-packages/PIL/*
    /home/pi/.local/lib/python3.9/site-packages/pillow-10.2.0.dist-info/*
Proceed (Y/n)? Y
  Successfully uninstalled pillow-10.2.0
pi@raspberrypi:~ $ pip3 install Pillow
Defaulting to user installation because normal site-packages is not writeable
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Collecting Pillow
  Using cached https://www.piwheels.org/simple/pillow/pillow-10.2.0-cp39-cp39-linux_armv7l.whl (1.2 MB)
Installing collected packages: Pillow
Successfully installed Pillow-10.2.0
0

There are 0 best solutions below