Face_recognition: Installation issue on the Mac

Created on 6 Sep 2017  路  3Comments  路  Source: ageitgey/face_recognition

  • face_recognition version:
  • Python version: 3.6.2
  • Operating System: Mac OSX Sierra

Description

I think something went wrong in that the boost may be linked with an incorrect python version. How do I uninstall totally the face_recognition? I tried:
pip3 uninstall face_recognition

But somehow it does not uninstall everything.

What I Did

Paste the command(s) you ran and the output.
face_recognition ./people/ ./pics/

/
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.6/bin/face_recognition", line 7, in <module>
    from face_recognition.cli import main
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/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.6/lib/python3.6/site-packages/face_recognition/api.py", line 4, in <module>
    import dlib
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/dlib/__init__.py", line 1, in <module>
    from .dlib import *
ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/dlib/dlib.so, 2): Symbol not found: _PyClass_Type
  Referenced from: /usr/local/lib/libboost_python.dylib
  Expected in: flat namespace
 in /usr/local/lib/libboost_python.dylib

If there was a crash, please include the traceback here.

Most helpful comment

This kind of error usually means boost was compiled for a different version of python than the one you are using to run the problem. Uninstalling the face_recognition library won't help.

You're running the program with Python 3 but maybe boost got installed for Python 2 accidentally?

When you installed boost, how did you do it? Did you use a command like brew install boost-python --with-python3 --without-python to tell it specifically to install boost for Python 3 and not Python 2? If not, that could be the issue and you'll need to re-install boost.

All 3 comments

This kind of error usually means boost was compiled for a different version of python than the one you are using to run the problem. Uninstalling the face_recognition library won't help.

You're running the program with Python 3 but maybe boost got installed for Python 2 accidentally?

When you installed boost, how did you do it? Did you use a command like brew install boost-python --with-python3 --without-python to tell it specifically to install boost for Python 3 and not Python 2? If not, that could be the issue and you'll need to re-install boost.

Ok, I use this to install dlib after building python 3 version of boost.
pip3 install dlib

Now it works. Thanks.

I have the same question even though I have installed dlib and boost. It turns out that the version of boost installed is for python 2. Therefore I uninstalled dlib and boost, then use the command brew install boost-python --with-python3 --without-python as ageitgey said, and install dlib. Finally it works.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Asma-Hawari picture Asma-Hawari  路  6Comments

Sparviero-Sughero picture Sparviero-Sughero  路  4Comments

InnovativeInventor picture InnovativeInventor  路  6Comments

xiao543348405 picture xiao543348405  路  5Comments

mrhydra-np picture mrhydra-np  路  3Comments