Reputation: 87
I am attempting to install dlib to my python virtual environment.
There is a very similar problem here and I followed the exact steps to no avail.
Somehow I am able to import dlib when running code and I managed to do that by git cloning git clone -b pybind11 https://github.com/supervacuus/dlib.git
.
But when I attempt to install it pip3 install dlib or a library that depends on it such as pip3 install face_recognition I get errors stating that ERROR: Failed building wheel for dlib
Full execution logs and error here https://gist.github.com/GhettoBurger996/1e6a423b88b7435c8759255e19fa5e60
I am using 3.5.2 and Ubuntu 16.04
Upvotes: 3
Views: 4810
Reputation: 1
Python development headers are files used for compiling C/C++ code that interfaces with the Python programming language. These header files define the Python API and are essential when you're building C/C++ extensions for Python, or any other code that needs to interact with the Python interpreter at a low level. Without these headers, the compiler won't have the necessary information to interact with the Python runtime. They are typically needed when installing packages with parts written in C/C++, like dlib.
So first install Python dev version by this command
sudo apt-get install python3.8-dev
#It may depends on which version of python3 you are using
Now install dlib by using this command (Make sure install cmake before it)
pip install dlib
Upvotes: 0
Reputation: 121
Question is a bit old but I ran into a similar problem where installing dlib using pip3 would fail.
Installing the following dependencies fixed it for me:
$ sudo apt-get install build-essential cmake
$ sudo apt-get install libgtk-3-dev
$ sudo apt-get install libboost-all-dev
From the posted error logs it seems that you had cmake installed already so the first line might not be necessary for you.
Upvotes: 8