web-dev-qa-db-fra.com

Erreur d'installation de Dlib?

Visual studio 2015 n'est pas installé J'ai installé toutes les exigences avant de construire dlib en python: Cmake

python 3.6 et autres liaisons.

lors de l'installation de dlib à l'aide de pip:

pip install dlib

Vous avez une erreur:

Collecting dlib
  Using cached https://files.pythonhosted.org/packages/df/aa/6a9bb2a763107bb2606d6ee1aa65fcd3b51375a9ef6436e9c9280b0dd63c/dlib-19.15.0.tar.gz
Building wheels for collected packages: dlib
  Running setup.py bdist_wheel for dlib ... error
  Complete output from command "c:\users\vikas tiwari\anaconda3\python.exe" -u -c "import setuptools, tokenize;__file__='C:\\Users\\VIKAST~1\\AppData\\Local\\Temp\\pip-install-4f4b8868\\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\VIKAST~1\AppData\Local\Temp\pip-wheel-nnayeybw --python-tag cp36:
  running bdist_wheel
  running build
  running build_py
  package init file 'dlib\__init__.py' not found (or not a regular file)
  running build_ext
  Building extension for Python 3.6.5 |Anaconda, Inc.| (default, Mar 29 2018, 13:32:41) [MSC v.1900 64 bit (AMD64)]
  Invoking CMake setup: 'cmake C:\Users\VIKAST~1\AppData\Local\Temp\pip-install-4f4b8868\dlib\tools\python -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\Users\VIKAST~1\AppData\Local\Temp\pip-install-4f4b8868\dlib\build\lib.win-AMD64-3.6 -DPYTHON_EXECUTABLE=c:\users\vikas tiwari\anaconda3\python.exe -DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\Users\VIKAST~1\AppData\Local\Temp\pip-install-4f4b8868\dlib\build\lib.win-AMD64-3.6 -A x64'
  -- Building for: Visual Studio 14 2015
  -- Selecting Windows SDK version  to target Windows 10.0.17134.
  CMake Error in CMakeLists.txt:
    Failed to run MSBuild command:

      C:/Program Files (x86)/MSBuild/14.0/bin/MSBuild.exe

    to get the value of VCTargetsPath:

      Microsoft (R) Build Engine version 14.0.25420.1
      Copyright (C) Microsoft Corporation. All rights reserved.

      Build started 8/7/2018 1:07:47 PM.
      Project "C:\Users\Vikas Tiwari\AppData\Local\Temp\pip-install-4f4b8868\dlib\build\temp.win-AMD64-3.6\Release\CMakeFiles\3.12.0\VCTargetsPath.vcxproj" on node 1 (default targets).
      C:\Users\Vikas Tiwari\AppData\Local\Temp\pip-install-4f4b8868\dlib\build\temp.win-AMD64-3.6\Release\CMakeFiles\3.12.0\VCTargetsPath.vcxproj(14,2): error MSB4019: The imported project "C:\Microsoft.Cpp.Default.props" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.
      Done Building Project "C:\Users\Vikas Tiwari\AppData\Local\Temp\pip-install-4f4b8868\dlib\build\temp.win-AMD64-3.6\Release\CMakeFiles\3.12.0\VCTargetsPath.vcxproj" (default targets) -- FAILED.

      Build FAILED.

      "C:\Users\Vikas Tiwari\AppData\Local\Temp\pip-install-4f4b8868\dlib\build\temp.win-AMD64-3.6\Release\CMakeFiles\3.12.0\VCTargetsPath.vcxproj" (default target) (1) ->
        C:\Users\Vikas Tiwari\AppData\Local\Temp\pip-install-4f4b8868\dlib\build\temp.win-AMD64-3.6\Release\CMakeFiles\3.12.0\VCTargetsPath.vcxproj(14,2): error MSB4019: The imported project "C:\Microsoft.Cpp.Default.props" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.

          0 Warning(s)
          1 Error(s)

      Time Elapsed 00:00:00.03


    Exit code: 1



  -- Configuring incomplete, errors occurred!
  See also "C:/Users/Vikas Tiwari/AppData/Local/Temp/pip-install-4f4b8868/dlib/build/temp.win-AMD64-3.6/Release/CMakeFiles/CMakeOutput.log".
  Traceback (most recent call last):
    File "<string>", line 1, in <module>
    File "C:\Users\VIKAST~1\AppData\Local\Temp\pip-install-4f4b8868\dlib\setup.py", line 257, in <module>
      'Topic :: Software Development',
    File "c:\users\vikas tiwari\anaconda3\lib\site-packages\setuptools\__init__.py", line 129, in setup
      return distutils.core.setup(**attrs)
    File "c:\users\vikas tiwari\anaconda3\lib\distutils\core.py", line 148, in setup
      dist.run_commands()
    File "c:\users\vikas tiwari\anaconda3\lib\distutils\dist.py", line 955, in run_commands
      self.run_command(cmd)
    File "c:\users\vikas tiwari\anaconda3\lib\distutils\dist.py", line 974, in run_command
      cmd_obj.run()
    File "c:\users\vikas tiwari\anaconda3\lib\site-packages\wheel\bdist_wheel.py", line 202, in run
      self.run_command('build')
    File "c:\users\vikas tiwari\anaconda3\lib\distutils\cmd.py", line 313, in run_command
      self.distribution.run_command(command)
    File "c:\users\vikas tiwari\anaconda3\lib\distutils\dist.py", line 974, in run_command
      cmd_obj.run()
    File "c:\users\vikas tiwari\anaconda3\lib\distutils\command\build.py", line 135, in run
      self.run_command(cmd_name)
    File "c:\users\vikas tiwari\anaconda3\lib\distutils\cmd.py", line 313, in run_command
      self.distribution.run_command(command)
    File "c:\users\vikas tiwari\anaconda3\lib\distutils\dist.py", line 974, in run_command
      cmd_obj.run()
    File "C:\Users\VIKAST~1\AppData\Local\Temp\pip-install-4f4b8868\dlib\setup.py", line 133, in run
      self.build_extension(ext)
    File "C:\Users\VIKAST~1\AppData\Local\Temp\pip-install-4f4b8868\dlib\setup.py", line 170, in build_extension
      subprocess.check_call(cmake_setup, cwd=build_folder)
    File "c:\users\vikas tiwari\anaconda3\lib\subprocess.py", line 291, in check_call
      raise CalledProcessError(retcode, cmd)
  subprocess.CalledProcessError: Command '['cmake', 'C:\\Users\\VIKAST~1\\AppData\\Local\\Temp\\pip-install-4f4b8868\\dlib\\tools\\python', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\\Users\\VIKAST~1\\AppData\\Local\\Temp\\pip-install-4f4b8868\\dlib\\build\\lib.win-AMD64-3.6', '-DPYTHON_EXECUTABLE=c:\\users\\vikas tiwari\\anaconda3\\python.exe', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\\Users\\VIKAST~1\\AppData\\Local\\Temp\\pip-install-4f4b8868\\dlib\\build\\lib.win-AMD64-3.6', '-A', 'x64']' returned non-zero exit status 1.

  ----------------------------------------
  Failed building wheel for dlib
  Running setup.py clean for dlib
Failed to build dlib
Installing collected packages: dlib
  Running setup.py install for dlib ... error
    Complete output from command "c:\users\vikas tiwari\anaconda3\python.exe" -u -c "import setuptools, tokenize;__file__='C:\\Users\\VIKAST~1\\AppData\\Local\\Temp\\pip-install-4f4b8868\\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\VIKAST~1\AppData\Local\Temp\pip-record-aol24hcc\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
    Building extension for Python 3.6.5 |Anaconda, Inc.| (default, Mar 29 2018, 13:32:41) [MSC v.1900 64 bit (AMD64)]
    Invoking CMake setup: 'cmake C:\Users\VIKAST~1\AppData\Local\Temp\pip-install-4f4b8868\dlib\tools\python -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\Users\VIKAST~1\AppData\Local\Temp\pip-install-4f4b8868\dlib\build\lib.win-AMD64-3.6 -DPYTHON_EXECUTABLE=c:\users\vikas tiwari\anaconda3\python.exe -DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\Users\VIKAST~1\AppData\Local\Temp\pip-install-4f4b8868\dlib\build\lib.win-AMD64-3.6 -A x64'
    -- Building for: Visual Studio 14 2015
    -- Selecting Windows SDK version  to target Windows 10.0.17134.
    CMake Error in CMakeLists.txt:
      Failed to run MSBuild command:

        C:/Program Files (x86)/MSBuild/14.0/bin/MSBuild.exe

      to get the value of VCTargetsPath:

        Microsoft (R) Build Engine version 14.0.25420.1
        Copyright (C) Microsoft Corporation. All rights reserved.

        Build started 8/7/2018 1:07:50 PM.
        Project "C:\Users\Vikas Tiwari\AppData\Local\Temp\pip-install-4f4b8868\dlib\build\temp.win-AMD64-3.6\Release\CMakeFiles\3.12.0\VCTargetsPath.vcxproj" on node 1 (default targets).
        C:\Users\Vikas Tiwari\AppData\Local\Temp\pip-install-4f4b8868\dlib\build\temp.win-AMD64-3.6\Release\CMakeFiles\3.12.0\VCTargetsPath.vcxproj(14,2): error MSB4019: The imported project "C:\Microsoft.Cpp.Default.props" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.
        Done Building Project "C:\Users\Vikas Tiwari\AppData\Local\Temp\pip-install-4f4b8868\dlib\build\temp.win-AMD64-3.6\Release\CMakeFiles\3.12.0\VCTargetsPath.vcxproj" (default targets) -- FAILED.

        Build FAILED.

        "C:\Users\Vikas Tiwari\AppData\Local\Temp\pip-install-4f4b8868\dlib\build\temp.win-AMD64-3.6\Release\CMakeFiles\3.12.0\VCTargetsPath.vcxproj" (default target) (1) ->
          C:\Users\Vikas Tiwari\AppData\Local\Temp\pip-install-4f4b8868\dlib\build\temp.win-AMD64-3.6\Release\CMakeFiles\3.12.0\VCTargetsPath.vcxproj(14,2): error MSB4019: The imported project "C:\Microsoft.Cpp.Default.props" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.

            0 Warning(s)
            1 Error(s)

        Time Elapsed 00:00:00.03


      Exit code: 1



    -- Configuring incomplete, errors occurred!
    See also "C:/Users/Vikas Tiwari/AppData/Local/Temp/pip-install-4f4b8868/dlib/build/temp.win-AMD64-3.6/Release/CMakeFiles/CMakeOutput.log".
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "C:\Users\VIKAST~1\AppData\Local\Temp\pip-install-4f4b8868\dlib\setup.py", line 257, in <module>
        'Topic :: Software Development',
      File "c:\users\vikas tiwari\anaconda3\lib\site-packages\setuptools\__init__.py", line 129, in setup
        return distutils.core.setup(**attrs)
      File "c:\users\vikas tiwari\anaconda3\lib\distutils\core.py", line 148, in setup
        dist.run_commands()
      File "c:\users\vikas tiwari\anaconda3\lib\distutils\dist.py", line 955, in run_commands
        self.run_command(cmd)
      File "c:\users\vikas tiwari\anaconda3\lib\distutils\dist.py", line 974, in run_command
        cmd_obj.run()
      File "c:\users\vikas tiwari\anaconda3\lib\site-packages\setuptools\command\install.py", line 61, in run
        return orig.install.run(self)
      File "c:\users\vikas tiwari\anaconda3\lib\distutils\command\install.py", line 545, in run
        self.run_command('build')
      File "c:\users\vikas tiwari\anaconda3\lib\distutils\cmd.py", line 313, in run_command
        self.distribution.run_command(command)
      File "c:\users\vikas tiwari\anaconda3\lib\distutils\dist.py", line 974, in run_command
        cmd_obj.run()
      File "c:\users\vikas tiwari\anaconda3\lib\distutils\command\build.py", line 135, in run
        self.run_command(cmd_name)
      File "c:\users\vikas tiwari\anaconda3\lib\distutils\cmd.py", line 313, in run_command
        self.distribution.run_command(command)
      File "c:\users\vikas tiwari\anaconda3\lib\distutils\dist.py", line 974, in run_command
        cmd_obj.run()
      File "C:\Users\VIKAST~1\AppData\Local\Temp\pip-install-4f4b8868\dlib\setup.py", line 133, in run
        self.build_extension(ext)
      File "C:\Users\VIKAST~1\AppData\Local\Temp\pip-install-4f4b8868\dlib\setup.py", line 170, in build_extension
        subprocess.check_call(cmake_setup, cwd=build_folder)
      File "c:\users\vikas tiwari\anaconda3\lib\subprocess.py", line 291, in check_call
        raise CalledProcessError(retcode, cmd)
    subprocess.CalledProcessError: Command '['cmake', 'C:\\Users\\VIKAST~1\\AppData\\Local\\Temp\\pip-install-4f4b8868\\dlib\\tools\\python', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\\Users\\VIKAST~1\\AppData\\Local\\Temp\\pip-install-4f4b8868\\dlib\\build\\lib.win-AMD64-3.6', '-DPYTHON_EXECUTABLE=c:\\users\\vikas tiwari\\anaconda3\\python.exe', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\\Users\\VIKAST~1\\AppData\\Local\\Temp\\pip-install-4f4b8868\\dlib\\build\\lib.win-AMD64-3.6', '-A', 'x64']' returned non-zero exit status 1.

    ----------------------------------------
Command ""c:\users\vikas tiwari\anaconda3\python.exe" -u -c "import setuptools, tokenize;__file__='C:\\Users\\VIKAST~1\\AppData\\Local\\Temp\\pip-install-4f4b8868\\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\VIKAST~1\AppData\Local\Temp\pip-record-aol24hcc\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\VIKAST~1\AppData\Local\Temp\pip-install-4f4b8868\dlib\

Je n'ai vraiment aucune idée du véritable problème ici. Dois-je installer Visual Studio pour compiler les fichiers c ++ de dlib? Ne pas avoir VS 2015 installé en ce moment !!

6
Vikas TIwari

Oubliez tout et essayez la méthode pour installer dlib et/ou opencv ici à partir de zéro.

C'est une méthode très simple en 3 étapes

  1. Installez anaconda
  2. Activer l'environnement virtuel à l'aide de cmd
  3. Installez dlib et opencv à l'aide de pip via cmd.

Vous pouvez également vous connecter au thread this .

2
Legolas

Voici :

  • Téléchargez CMake depuis cmake et ajoutez-le à PATH (C:\Program Files\CMake\bin)
  • Installer dlib en utilisant pip (pip install dlib == 19.4)
0
ASHu2

Voici comment j'ai résolu le même problème.

  1. Assurez-vous d'avoir installé cmake et CMAKE_FOLDER\bin l'a ajouté dans l'environnement disponible
  2. Installer anaconda
  3. puis exécutez les commandes suivantes dans anaconda Shell.

conda update conda

conda update anaconda

  1. créer un nouvel environnement conda create -n env_dlib python=3.6
  2. activer l'environnement conda activate env_dlib
  3. installez dlib conda install -c conda-forge dlib

Vérifiez votre installation dans python Shell en utilisant

import dlib dlib.__version__

0
Shakeel Hussain