face_recognition icon indicating copy to clipboard operation
face_recognition copied to clipboard

DLL load failed while importing _dlib_pybind11: A dynamic link library (DLL) initialization routine failed.

Open MrMak21 opened this issue 5 years ago • 5 comments

  • face_recognition version: 1.3.0
  • Python version: 3.7
  • Operating System: Windows 10

Description

Trying to implement face_recognition library and when i isntalled it from pip there i am getting this error when i try to run my script

What I Did

I imported dlib from conda and face_Recognition through pip. When i run my script i am getting this error: DLL load failed while importing _dlib_pybind11: A dynamic link library (DLL) initialization routine failed.

This is the whole stacktrace

Traceback (most recent call last):
  File "C:/Users/***/PycharmProjects/pythonProject/CameraLib.py", line 4, in <module>
    import face_recognition
  File "C:\Users\***\anaconda3\envs\pythonProject\lib\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 "C:\Users\***\anaconda3\envs\pythonProject\lib\site-packages\face_recognition\api.py", line 4, in <module>
    import dlib
  File "C:\Users\***\anaconda3\envs\pythonProject\lib\site-packages\dlib\__init__.py", line 19, in <module>
    from _dlib_pybind11 import *
ImportError: DLL load failed while importing _dlib_pybind11: A dynamic link library (DLL) initialization routine failed.

MrMak21 avatar Oct 29 '20 12:10 MrMak21

Hey! MrMake i think that u should try installing both dlib and facerecognition through same idle ( different idle may create some problems ) and i think that u don't have to install dlib seperately ( atleast for version 3.19.0 ) its already included in face_recognition library , further check if u have all necessary library installed such as Click,CMake, opencv , numpy it favours in installation( recommended - try to use latest ve5sion of python(3.9.0)) ( Furthermore if you are installing it in visual studio code terminal make sure that you have have visual studio community installed )

Edith-panda avatar Nov 30 '20 05:11 Edith-panda

I had a similar problem with the line 19 "from _dlib_pybind11 import *" in Ubuntu.

IsacSouzaCampos avatar May 21 '21 02:05 IsacSouzaCampos

Any solution around there? @MrMak21 did you fix that?

dofamin-1 avatar Apr 09 '22 07:04 dofamin-1

@dofamin-1 yes i found that the problem was with my proccesor. It didn't support these operations. When i changed and test this on another pc with intel xeon it was running perfect

MrMak21 avatar Apr 22 '22 19:04 MrMak21

Same here in my case...

mkeykhan avatar Jun 24 '22 09:06 mkeykhan