ASN
ASN

Reputation: 41

Dlib installation python 2.7

Former marine grunt here! New to python and coding. Trying to install DLIB for python 2.7. I run the command pip install dlib and keep getting this error message:

Collecting dlib
  Using cached dlib-19.1.0.tar.gz 
Building wheels for collected packages: dlib
  Running setup.py bdist_wheel for dlib ... error
Complete output from command c:\python27\python.exe -u -c "import setuptools, tokenize;__file__='c:\\users\\pickfl~1\\appdata\\local\\temp\\pip-build-4qhao2\\dlib\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', \n');f.close();exec(compile(code, __file__, 'exec'))" 
bdist_wheel -d c:\users\pickfl~1\appdata\local\temp\tmpcvgy9jpip-wheel- --python-tag cp27:
  running bdist_wheel
  running build
  Detected Python architecture: 32bit
  Detected platform: win32
  Configuring cmake ...
  -- Building for: NMake Makefiles
  -- The C compiler identification is unknown
  -- The CXX compiler identification is unknown
  CMake Error in CMakeLists.txt:
    The CMAKE_C_COMPILER:
      cl
    is not a full path and was not found in the PATH.
    To use the NMake generator with Visual C++, cmake must be run from a shell
    that can use the compiler cl from the command line.  This environment is
    unable to invoke the cl compiler.  To fix this problem, run cmake from the
    Visual Studio Command Prompt (vcvarsall.bat).
    Tell CMake where to find the compiler by setting either the environment
    variable "CC" or the CMake cache entry CMAKE_C_COMPILER to the full path to
    the compiler, or to the compiler name if it is in the PATH.
  CMake Error in CMakeLists.txt:
    The CMAKE_CXX_COMPILER:
      cl
    is not a full path and was not found in the PATH.
    To use the NMake generator with Visual C++, cmake must be run from a shell
    that can use the compiler cl from the command line.  This environment is
    unable to invoke the cl compiler.  To fix this problem, run cmake from the
    Visual Studio Command Prompt (vcvarsall.bat).
    Tell CMake where to find the compiler by setting either the environment
    variable "CXX" or the CMake cache entry CMAKE_CXX_COMPILER to the full path
    to the compiler, or to the compiler name if it is in the PATH.
  -- Configuring incomplete, errors occurred!
  See also "C:/Users/Pickflickr1/AppData/Local/Temp/pip-build-4qhao2/dlib/tools/python/build/CMakeFiles/CMakeOutput.log".
  See also "C:/Users/Pickflickr1/AppData/Local/Temp/pip-build-4qhao2/dlib/tools/python/build/CMakeFiles/CMakeError.log".
  error: cmake configuration failed!

  ----------------------------------------   Failed building wheel for dlib

Along with this:
 Command "c:\python27\python.exe -u -c "import setuptools, tokenize;__file__='c:\\users\\pickfl~1\\appdata\\local\\temp\\pip-build-4qhao2\\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 c:\users\pickfl~1\appdata\local\temp\pip-l8pcsq-record\install-record.txt
--single-version-externally-managed --compile" failed with error code 1 in c:\users\pickfl~1\appdata\local\temp\pip-build-4qhao2\dlib\

Any feedback or help would be great! Former jarhead so bear with me, thanks.

Upvotes: 4

Views: 22139

Answers (4)

Madhurish Gupta
Madhurish Gupta

Reputation: 43

First Install all the dependencies for dlib library :->

sudo apt-get install python-dev python-pip

sudo apt-get install build-essential cmake pkg-config

sudo apt-get install libx11-dev libatlas-base-dev

sudo apt-get install libgtk-3-dev libboost-python-dev

Then Execute

pip install dlib

Enjoy computer-vision.....

“A lot of the future of search is going to be about pictures. Computer vision technology is going to be a big deal”

Ben Silbermann

Upvotes: 4

PanNik
PanNik

Reputation: 1764

The pip package might be broken or might not be updated. Anyway, download the dlib_master from :https://github.com/davisking/dlib.git

After that there is an easy guide for installation in python. Go to the folder containing setup.py and then open terminal or whatever and type sudo python setup.py install.

Upvotes: 0

Nachiket
Nachiket

Reputation: 182

First you need to have pip installed. Then you can download the dlib python 2.7 version from "https://pypi.python.org/pypi/dlib/18.17.100" website where you will get wheel of dlib. And then use normal procedure like pip install 'path to dlib wheel'.

For ex. f you have saved .whl file to downloads folder then type pip install C:\Users\XYZ\Downloads\dlib-18.17.100-cp27-none-win32.whl.

This will surely work. When I tried I didn't get any error and dlib got successfully installed.

Cheers

Upvotes: 3

Elena Zherdeva
Elena Zherdeva

Reputation: 150

Try this:

conda install -c menpo dlib=18.18

Upvotes: 4

Related Questions