Skip to content Skip to sidebar Skip to footer

How To Solve Issue Related To Installation Of Dlib On Windows 10?

I am trying to install dlib for face-recognition for python 3.7 on windows 10, I explored few ways but I am getting errors.I tried below steps- Installed cmake using 'pip install

Solution 1:

In my system i'd done using Anaconda. The Dlib library supports python 3.6 to 3.7.0 in conda environments.

follow the instruction to install face recognition model,

  1. install Anaconda from https://www.anaconda.com/distribution/#download-section

  2. in conda prompt, create an environment using this command

    conda create --name env_name python=3.7.0

  3. then activate the env

    conda activate env_name

  4. install dlib

conda install -c conda-forge dlib=19.17

  1. now install face_recogintion models using pip

pip install face_recogntion

Solution 2:

Installing face_recognition on Windows 10

Requirements:

  1. Microsoft Visual Studio 2015 (or newer) with C/C++ Compiler installed.

  2. Microsoft Visual C++ (MSVC) 14.0 installed (need to install the visual c++ build tools)

  3. CMake for windows and add it to your system environment variables

  4. Boost installed and added to system environment variables

  5. Python 3 with the same system type as your OS (ie. 64-bit, 32-bit)

Installing MSVC 14.0 and Cmake for windows

  1. Download Microsoft C++ build tools from https://visualstudio.microsoft.com/visual-cpp-build-tools/ and install
  2. Once the installation finished, click on modify in the Visual Studio Build Tools 2019 (2) section
  3. Go to the Individual components tab, under the Compilers, build tools, and runtimes, tick on C++ CMake tools for Windows and MSVC v140
  • VS 2015 C++ build tools (v14.00) and click modify. The Visual Studio Installer will begin to download and install MSVC 14.0 and Cmake for you

Adding MSVC 14.0 and Cmake to System Variables

  1. On the search tab, type This PC and right-click, choose properties
  2. Go to the Advanced system settings, under Advanced tab click on Environment Variables
  3. Under System variables, click New… and fill the following: Name: VS140COMNTOOLS Value: C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\Tools\
  4. Click OK
  5. Under User variables, click on variable named Path and click Edit…
  6. Click New and fill “C:\Program Files\CMake\bin”
  7. Click OK, click OK again

Installing Boost and face_recognition

  1. Download Boost library source code or binary release for your current MSVC from https://sourceforge.net/projects/boost/files/
  2. Extract the Boost source files into C:\local\boost_1_XX_X (X means the current version of Boost you have). You may need to create local directory
  3. Open Developer Command Prompt for Visual Studio and go to the current directory of Boost extracted and try these commands to compile Boost: bootstrap b2 -a --with-python address-model=64 toolset=msvc runtime-link=static
  4. If you successfully compile Boost, it should create compiled files in stage directory
  5. Go to Command prompt and type $ pip install face_recognition

Post a Comment for "How To Solve Issue Related To Installation Of Dlib On Windows 10?"