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?
It may take a while to build wheel for dlib, after a while, it will be successfully installed. ... 10 mins for that "building wheel loop" to end and then it was installed successfully! Would advise to first wait for 10-15 minutes at least, before trying other answers given above.
Just a note for reference that the easiest way to install is now to use:
sudo python setup.py install
Instead of manual file editing, you can pass -DPYTHON_LIBRARY:FILEPATH=/path/to/your/libpython2.7.dylib
to cmake
.
What ./compile_dlib_python_module.bat
does is
mkdir build
cd build
cmake ../../tools/python
So, just run the commands by one by one and instead of
cmake ../../tools/python
run
cmake ../../tools/python -DPYTHON_LIBRARY:FILEPATH=/usr/local/Cellar/python/2.7.8/Frameworks/Python.framework/Versions/2.7/lib/libpython2.7.dylib
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With