face_recognition installation issue i am trying to install it but it is giving me the below error
pip install face_recognition
Collecting face_recognition
Using cached face_recognition-1.2.1-py2.py3-none-any.whl
Collecting dlib>=19.7 (from face_recognition)
Downloading dlib-19.9.0.tar.gz (3.1MB)
100% |鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅| 3.1MB 355kB/s
Collecting face-recognition-models>=0.3.0 (from face_recognition)
Downloading face_recognition_models-0.3.0.tar.gz (100.1MB)
100% |鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅| 100.2MB 2.2kB/s
Collecting numpy (from face_recognition)
Downloading numpy-1.14.0-cp27-cp27mu-manylinux1_x86_64.whl (16.9MB)
100% |鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅| 16.9MB 79kB/s
Collecting scipy>=0.17.0 (from face_recognition)
Downloading scipy-1.0.0-cp27-cp27mu-manylinux1_x86_64.whl (46.7MB)
100% |鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅| 46.7MB 30kB/s
Collecting Click>=6.0 (from face_recognition)
Downloading click-6.7-py2.py3-none-any.whl (71kB)
100% |鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅| 71kB 1.4MB/s
Collecting Pillow (from face_recognition)
Downloading Pillow-5.0.0-cp27-cp27mu-manylinux1_x86_64.whl (5.8MB)
100% |鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅| 5.9MB 221kB/s
Installing collected packages: dlib, face-recognition-models, numpy, scipy, Click, Pillow, face-recognition
Running setup.py install for dlib ... error
Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-BhT2nn/dlib/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-mbcvDj-record/install-record.txt --single-version-externally-managed --compile:
running install
running build
running build_py
package init file 'dlib/__init__.py' not found (or not a regular file)
running build_ext
Invoking CMake setup: 'cmake /tmp/pip-build-BhT2nn/dlib/tools/python -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/tmp/pip-build-BhT2nn/dlib/build/lib.linux-x86_64-2.7 -DPYTHON_EXECUTABLE=/usr/bin/python -DCMAKE_BUILD_TYPE=Release'
error: [Errno 2] No such file or directory
----------------------------------------
Command "/usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-BhT2nn/dlib/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-mbcvDj-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-BhT2nn/dlib/
Something is going wrong while trying to compile the dlib module. I'd recommend downloading the dlib source code and compiling it manually so you can get a more detailed error message.
Instructions: https://gist.github.com/ageitgey/629d75c1baac34dfa5ca2a1928a7aeaf
install cmake by either using
yum install cmake
or
apt-get install cmake
then do a pip install for dlib
sudo apt install cmake
pip3 install dlib
It's useful. Thank you @manishmudgal
Most helpful comment
install cmake by either using
yum install cmake
or
apt-get install cmake
then do a pip install for dlib