Mojave : Build dlib : issue : fatal error: ‘X11/Xlib.h’ file not found

Quand j’essaye de faire le build de dlib j’ai l’erreur suivante :

In file included from /private/var/folders/72/mwd843qs5dnfxxzc5zzwx5mw0000gn/T/pip-install-yx4dc86g/dlib/dlib/gui_widgets/fonts.cpp:16:
    /private/var/folders/72/mwd843qs5dnfxxzc5zzwx5mw0000gn/T/pip-install-yx4dc86g/dlib/dlib/gui_widgets/nativefont.h:27:10: fatal error: 'X11/Xlib.h' file not found
    #include <X11/Xlib.h>
             ^~~~~~~~~~~~
    1 error generated.
    make[2]: *** [dlib_build/CMakeFiles/dlib.dir/gui_widgets/fonts.cpp.o] Error 1
    make[2]: *** Waiting for unfinished jobs....
    make[1]: *** [dlib_build/CMakeFiles/dlib.dir/all] Error 2
    make: *** [all] Error 2

Pour fixer le problème :

ln -s /opt/X11/include/X11 /usr/local/include/X11

J’ai donc pu faire la compilation de dlib qui est utilisé par face_recognition :

$ pip install face_recognition
Collecting face_recognition
  Using cached https://files.pythonhosted.org/packages/3f/ed/ad9a28042f373d4633fc8b49109b623597d6f193d3bbbef7780a5ee8eef2/face_recognition-1.2.3-py2.py3-none-any.whl
Requirement already satisfied: numpy in /usr/local/lib/python3.7/site-packages (from face_recognition) (1.16.1)
Requirement already satisfied: Pillow in /usr/local/lib/python3.7/site-packages (from face_recognition) (5.4.1)
Collecting dlib>=19.7 (from face_recognition)
  Using cached https://files.pythonhosted.org/packages/35/8d/e4ddf60452e2fb1ce3164f774e68968b3f110f1cb4cd353235d56875799e/dlib-19.16.0.tar.gz
Requirement already satisfied: face-recognition-models>=0.3.0 in /usr/local/lib/python3.7/site-packages (from face_recognition) (0.3.0)
Collecting Click>=6.0 (from face_recognition)
  Using cached https://files.pythonhosted.org/packages/fa/37/45185cb5abbc30d7257104c434fe0b07e5a195a6847506c074527aa599ec/Click-7.0-py2.py3-none-any.whl
Building wheels for collected packages: dlib
  Building wheel for dlib (setup.py) ... done
  Stored in directory: /Users/.../Library/Caches/pip/wheels/ce/f9/bc/1c51cd0b40a2b5dfd46ab79a73832b41e7c3aa918a508154f0
Successfully built dlib
Installing collected packages: dlib, Click, face-recognition
Successfully installed Click-7.0 dlib-19.16.0 face-recognition-1.2.3

A suivre.

Laisser un commentaire

Votre adresse e-mail ne sera pas publiée. Les champs obligatoires sont indiqués avec *

Time limit is exhausted. Please reload CAPTCHA.