ageitgey / face_recognition

The world's simplest facial recognition api for Python and the command line
MIT License
53.53k stars 13.5k forks source link

cannot import face_recognition #139

Open leesper opened 7 years ago

leesper commented 7 years ago

Description

I tried to import face_recognition, but get an error of libboost_python.so.1.64.0 not found

What I Did

I pip install the face_recognition, and install the newest boost 1.64.0

>>> import face_recognition
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python2.7/site-packages/face_recognition/__init__.py", line 7, in <module>
    from .api import load_image_file, face_locations, face_landmarks, face_encodings, compare_faces, face_distance
  File "/usr/lib/python2.7/site-packages/face_recognition/api.py", line 4, in <module>
    import dlib
  File "/usr/lib64/python2.7/site-packages/dlib/__init__.py", line 1, in <module>
    from .dlib import *
ImportError: libboost_python.so.1.64.0: cannot open shared object file: No such file or directory
edentyin commented 7 years ago

Python version: 3.6 Operating System: MacOS 10.12.6 I tried to import face_recognition on pycham, but get an error of 'Process finished with exit code 139 (interrupted by signal 11: SIGSEGV)': what can I do to fix it?

ageitgey commented 7 years ago

@leesper Seems to be something with how dlib looks for that library, but I'm not really sure. According this page, copying libboost to the current folder might work but that seems like a bad workaround: https://stackoverflow.com/questions/44627506/cant-import-so-file-from-another-so

@edentyin That's unrelated to this issue. See #83 instead. Sounds like the issue is that using Anaconda Python on OSX with dlib doesn't work. I haven't seen the issue myself maybe because I use the Python.org version of Python on OSX.

tetrahydra commented 7 years ago

I got similar issue. I use the ubuntu vmware and when running got an error that it cannot import face_recognition.

i ran the file on the face_recognition examples folder.

python facerec_from_webcam_faster.py

leesper commented 7 years ago

@ageitgey thx, I'll have a try

molchen commented 7 years ago

first step: find if your system has libboost_python.so.1.64.0 or not cd / sudo find ./ -name libboost_python.so.1.64.0 second step: if the first step the libboost_python.so.1.64.0 exist, eg: /usr/local/lib/libboost_python.so.1.64.0 using strace to find the search path of python,if in these paths the libboost_python.so.1.64.0 doesn't exist, you can make of soft link to one of the search path eg: ln -s /usr/lib/libboost_python.so.1.64.0 /usr/local/lib/libboost_python.so.1.64.0 trying use strace python facerec_from_webcam_faster.py to find the

Cabchinoe commented 7 years ago

ln -s /usr/lib/libboost_python.so.1.64.0 /usr/local/lib/libboost_python.so.1.64.0 is incorrect reverse the params....