How to get Python import working with dlib (using cmake and osx)

Tim 333 picture Tim 333 · May 5, 2015 · Viewed 27.1k times · Source

Sorry if this is basic but I'm trying to install dlib to use with python as mentioned in (http://blog.dlib.net/2014/04/dlib-187-released-make-your-own-object.html) "Make your own object detector in Python!".

I downloaded the install files, unzipped, and used cmake as in the install instructions (http://dlib.net/compile.html)

cd examples
mkdir build
cd build
cmake ..
cmake --build . --config Release

which seemed to work fine

However typing "import dlib" in Python just gives ImportError: No module named dlib.

Any idea how I tell Python how to find / use the thing?

Answer

liezlp picture liezlp · Jun 23, 2016

Just a note for reference that the easiest way to install is now to use:

sudo python setup.py install