face_recognition
face_recognition copied to clipboard
Can't run Face Recognition on Apple Silicon M1
- face_recognition version: 1.3.0
- Python version: 3.8.10
- Operating System: macOS 12.1
Description
Can't run Face Recognition on Apple Silicon based Mac
What I Did
After installing face recognition using pip3 and running face_recognition
I get the following error message
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.8/bin/face_recognition", line 5, in <module>
from face_recognition.face_recognition_cli import main
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/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 "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/face_recognition/api.py", line 4, in <module>
import dlib
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/dlib/__init__.py", line 19, in <module>
from _dlib_pybind11 import *
ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/_dlib_pybind11.cpython-38-darwin.so, 0x0002): symbol not found in flat namespace '_png_do_expand_palette_rgb8_neon'
I am having same issue, have you found any work around ? @MemoryAccessRegister
Same here!
I am also getting the same error: symbol not found in flat namespace '_png_do_expand_palette_rgb8_neon' The error occurs in spite of the dlib package being installed for the relevant Python version.
I am using VSCode, in case that is relevant.
Can anyone please help me to fix this bug?
same here, getting the same issue has anyone solved it yet?
The issue is not with the apple m1, but in puthon some libraries overlap so thats why jt is fiving that error. For it you can use conda and inside that make virtual env and then download all the libraries need for you project. It worked well with me.
after trying everything with python 3.8 I have managed by using python 3.6 with pip install cmake dlib
The issue is not with the apple m1, but in puthon some libraries overlap so thats why jt is fiving that error. For it you can use conda and inside that make virtual env and then download all the libraries need for you project. It worked well with me.
This method did not work for me, I tried setting up a Conda environment with Python 3.10.4. It is showing me the same error.
@M4Marvin try installing python 3.8, then it will work fine, you just have to degrade the python version because of which you are getting error.
I got the solution for this, this works for me
First:
pip uninstall dlib
pip uninstall face-recognition
After uninstalling, refer to this website to install dlib step-by-step: https://gist.github.com/ageitgey/629d75c1baac34dfa5ca2a1928a7aeaf
After dlib is installed, you can now directly install face-recognition through the command line
pip install face-recognition
Refer to this website for more detail: https://face-recognition.readthedocs.io/en/latest/readme.html#installing-on-mac-or-linux
My Device: MacBook Air M1(8GB+256GB)
Let me know if I helped you to resolve this error.