-1

I'm trying to install Dlib with the following comand - "pip install dlib", but at the end of installation I`ve received an error:

File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.7_3.7.1264.0_x64__qbz5n2kfra8p0\lib\subprocess.py", line 347, in check_call
        raise CalledProcessError(retcode, cmd)
    subprocess.CalledProcessError: Command '['cmake', 'C:\\Users\\Koco\\AppData\\Local\\Temp\\pip-install-ge96cojw\\dlib\\tools\\python', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\\Users\\Koc
o\\AppData\\Local\\Temp\\pip-install-ge96cojw\\dlib\\build\\lib.win-amd64-3.7', '-DPYTHON_EXECUTABLE=C:\\Users\\Koco\\PycharmProjects\\untitled\\venv\\Scripts\\python.exe', '-DCMAKE_LIBR
ARY_OUTPUT_DIRECTORY_RELEASE=C:\\Users\\Koco\\AppData\\Local\\Temp\\pip-install-ge96cojw\\dlib\\build\\lib.win-amd64-3.7', '-A', 'x64']' returned non-zero exit status 1.

    ----------------------------------------
Command "C:\Users\Koco\PycharmProjects\untitled\venv\Scripts\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\Koco\\AppData\\Local\\Temp\\pip-install-ge96cojw\\dlib\\se
tup.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\Koco\AppData\Local\Temp
\pip-record-j0ufhjqu\install-record.txt --single-version-externally-managed --compile --install-headers C:\Users\Koco\PycharmProjects\untitled\venv\include\site\python3.7\dlib" failed wi
th error code 1 in C:\Users\Koco\AppData\Local\Temp\pip-install-ge96cojw\dlib\

I`ve installed "cmake" already.

m_____z
  • 1,521
  • 13
  • 22
kosi94
  • 1
  • 1

1 Answers1

0

Hi guys I found a solution on this problem. 1. Easyest way is to install Visual Studio and all packages for C++ or only the package for Dlib - this should slove the problem. On this link https://github.com/ageitgey/face_recognition/issues/175#issue-257710508 can be find detail descriprion for installation from "masoudr".

I will put the installation guide bellow: "Hi, I've successfully installed and tested this tool on my windows 10 machine and I'm writing a simple procedure to install it. It may be useful for some people try to use this tool on a Windows machine.

IMPORTANT: Actually this project has made for Linux systems and especially dlib. In my tests, the performance of this tool in Windows 10 was about a quarter in comparison with Ubuntu built with the same specs. But I haven't seen any difference between these two in other subjects.

Read First: The new version of dlib doesn't need Boost anymore so you can skip it. Remember that you still need to meet the following requirements. Requirments: (I've used this tutorial with these tools installed on Windows 10 but the newer versions may work too.)

Microsoft Visual Studio 2015 (or newer) with C/C++ Compiler installed. (Visual C++ 2015 Build Tools didn't work for me and I got into problems in compiling dlib) Boost library version 1.63 or newer. Also, you can use precompiled binaries for specific MSVC you have but I don't suggest. (I've included the compiling procedure of Boost in this tutorial) Of course Python3 (I used Python3.5 x64 but the other versions may work too) CMake for windows and add it to your system environment variables. Installation: Easy installation: Just install dlib and face_recognition (not always on newest version): pip install dlib and then pip install face_recognition.

Manual installation:

Download and install scipy and numpy+mkl (must be mkl version) packages from this link (all credits goes to Christoph Gohlke). Remember to grab the correct version based on your current Python version. Download Boost library source code or binary release for your current MSVC from this link. If you downloaded the binary version skip to step 4 else follow these steps to compile and build Boost by yourself: 3-1. Extract the Boost source files into C:\local\boost_1_XX_X (X means the current version of Boost you have) 3-2. Create a system variable with these parameters: Name: VS140COMNTOOLS Value: C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\Tools\ (or any path where you have installed MSVC) 3-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 3-4. If you successfully compile Boost, it should create compiled files in stage directory. (If you have already compiled Boost skip this step) If you already download the binary release just extract the contents to C:\local\boost_1_XX_X Grab latest version of dlib from this repo and extract it. Go to dlib directory and open cmd and follow these commands to build dlib: (remember to replace XX with the current version of Boost you have) set BOOST_ROOT=C:\local\boost_X_XX_X set BOOST_LIBRARYDIR=C:\local\boost_X_XX_X\stage\lib python setup.py install --yes USE_AVX_INSTRUCTIONS or python setup.py install --yes USE_AVX_INSTRUCTIONS --yes DLIB_USE_CUDA Now you can use import dlib without any problem in your python script. You can also check the current version of dlib with pip show dlib. Now simply install face_recognition with pip install face_recognition. Enjoy! Finally, I need to say thanks to @ageitgey and @davisking for their awesome work."

kosi94
  • 1
  • 1