face_recognition icon indicating copy to clipboard operation
face_recognition copied to clipboard

Can't Install Face Rec on Mac M1

Open stephenmatthews opened this issue 4 years ago • 3 comments

  • face_recognition version: 1.3.0
  • Python version: 3.9
  • Operating System: MacBook Pro M1 MacOS 12.1
  • PIP version: pip 21.3.1

Description

After installing face recognition using pip and running app.py I get the following error message -

Traceback (most recent call last): File "/Users/stephen/OneDrive - Ulster University/Year 4 - UUJ/COM668 - Project/webApp/COM668 - Project - Rapid Agency CMS/app.py", line 10, in <module> import face_recognition as fr File "/Library/Frameworks/Python.framework/Versions/3.9/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 "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/face_recognition/api.py", line 4, in <module> import dlib File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/dlib/__init__.py", line 19, in <module> from _dlib_pybind11 import * ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/_dlib_pybind11.cpython-39-darwin.so, 0x0002): symbol not found in flat namespace '_png_do_expand_palette_rgb8_neon'

What I Did

Tried uninstalling the package along with dlib

stephenmatthews avatar Jan 02 '22 11:01 stephenmatthews

Try with this answer : https://stackoverflow.com/questions/35006614/what-does-symbol-not-found-expected-in-flat-namespace-actually-mean

b5i avatar Jan 05 '22 14:01 b5i

  • face_recognition version: 1.3.0
  • Python version: 3.9
  • Operating System: MacBook Pro M1 MacOS 12.1
  • PIP version: pip 21.3.1

Description

After installing face recognition using pip and running app.py I get the following error message -

Traceback (most recent call last): File "/Users/stephen/OneDrive - Ulster University/Year 4 - UUJ/COM668 - Project/webApp/COM668 - Project - Rapid Agency CMS/app.py", line 10, in <module> import face_recognition as fr File "/Library/Frameworks/Python.framework/Versions/3.9/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 "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/face_recognition/api.py", line 4, in <module> import dlib File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/dlib/__init__.py", line 19, in <module> from _dlib_pybind11 import * ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/_dlib_pybind11.cpython-39-darwin.so, 0x0002): symbol not found in flat namespace '_png_do_expand_palette_rgb8_neon'

What I Did

Tried uninstalling the package along with dlib

I used python3.8 on my silicon Mac and it worked. Try with python3.8

b5i avatar Jan 05 '22 14:01 b5i

I have the same problem and the solution is as follows: Ensure that the environment is created for packages to be used by the Intel architecture。

Create environment command: ` CONDA_SUBDIR=osx-64 conda create -n test python=3.7

conda activate test

python -c "import platform;print(platform.machine())"

conda env config vars set CONDA_SUBDIR=osx-64

conda deactivate

conda activate test `

Insert-Code avatar Jan 19 '22 09:01 Insert-Code