невозможно установить dlib на python 3 - PullRequest
1 голос
/ 07 февраля 2020

Я пытаюсь установить dlib на python 3.7, но он всегда терпел неудачу

Я установил cmake и добавил его в свою среду, я обновил свой pip до последней версии, но каждый раз я запустить

pip install dlib

Возвращает ошибка как

Collecting dlib
  Using cached dlib-19.19.0.tar.gz (3.2 MB)
Installing collected packages: dlib
    Running setup.py install for dlib ... error
    ERROR: Command errored out with exit status 1:
     command: 'c:\users\charles\appdata\local\programs\python\python37\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Charles\\AppData\\Local\\Temp\\pip-install-6wd_c0pw\\dlib\\setup.py'"'"'; __file__='"'"'C:\\Users\\Charles\\AppData\\Local\\Temp\\pip-install-6wd_c0pw\\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\Charles\AppData\Local\Temp\pip-record-xchasbrx\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\users\charles\appdata\local\programs\python\python37\Include\dlib'
         cwd: C:\Users\Charles\AppData\Local\Temp\pip-install-6wd_c0pw\dlib\
    Complete output (74 lines):
    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.7.4 (tags/v3.7.4:e09359112e, Jul  8 2019, 20:34:20) [MSC v.1916 64 bit (AMD64)]
    Invoking CMake setup: 'cmake C:\Users\Charles\AppData\Local\Temp\pip-install-6wd_c0pw\dlib\tools\python -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\Users\Charles\AppData\Local\Temp\pip-install-6wd_c0pw\dlib\build\lib.win-amd64-3.7 -DPYTHON_EXECUTABLE=c:\users\charles\appdata\local\programs\python\python37\python.exe -DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\Users\Charles\AppData\Local\Temp\pip-install-6wd_c0pw\dlib\build\lib.win-amd64-3.7 -A x64'
    -- Building for: Visual Studio 10 2010
    CMake Error at CMakeLists.txt:3 (project):
      Failed to run MSBuild command:

        C:/Windows/Microsoft.NET/Framework/v4.0.30319/MSBuild.exe

      to get the value of VCTargetsPath:

        Microsoft (R) Build Engine version 4.8.3752.0
        [Microsoft .NET Framework, version 4.0.30319.42000]
        Copyright (C) Microsoft Corporation. All rights reserved.

        Build started 2/7/2020 12:37:32 PM.
        Project "C:\Users\Charles\AppData\Local\Temp\pip-install-6wd_c0pw\dlib\build\temp.win-amd64-3.7\Release\CMakeFiles\3.16.3\VCTargetsPath.vcxproj" on node 1 (default targets).
        C:\Users\Charles\AppData\Local\Temp\pip-install-6wd_c0pw\dlib\build\temp.win-amd64-3.7\Release\CMakeFiles\3.16.3\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\Charles\AppData\Local\Temp\pip-install-6wd_c0pw\dlib\build\temp.win-amd64-3.7\Release\CMakeFiles\3.16.3\VCTargetsPath.vcxproj" (default targets) -- FAILED.

        Build FAILED.

        "C:\Users\Charles\AppData\Local\Temp\pip-install-6wd_c0pw\dlib\build\temp.win-amd64-3.7\Release\CMakeFiles\3.16.3\VCTargetsPath.vcxproj" (default target) (1) ->
          C:\Users\Charles\AppData\Local\Temp\pip-install-6wd_c0pw\dlib\build\temp.win-amd64-3.7\Release\CMakeFiles\3.16.3\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.01


      Exit code: 1



    -- Configuring incomplete, errors occurred!
    See also "C:/Users/Charles/AppData/Local/Temp/pip-install-6wd_c0pw/dlib/build/temp.win-amd64-3.7/Release/CMakeFiles/CMakeOutput.log".
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "C:\Users\Charles\AppData\Local\Temp\pip-install-6wd_c0pw\dlib\setup.py", line 261, in <module>
        'Topic :: Software Development',
      File "c:\users\charles\appdata\local\programs\python\python37\lib\site-packages\setuptools\__init__.py", line 145, in setup
        return distutils.core.setup(**attrs)
      File "c:\users\charles\appdata\local\programs\python\python37\lib\distutils\core.py", line 148, in setup
        dist.run_commands()
      File "c:\users\charles\appdata\local\programs\python\python37\lib\distutils\dist.py", line 966, in run_commands
        self.run_command(cmd)
      File "c:\users\charles\appdata\local\programs\python\python37\lib\distutils\dist.py", line 985, in run_command
        cmd_obj.run()
      File "c:\users\charles\appdata\local\programs\python\python37\lib\site-packages\setuptools\command\install.py", line 61, in run
        return orig.install.run(self)
      File "c:\users\charles\appdata\local\programs\python\python37\lib\distutils\command\install.py", line 545, in run
        self.run_command('build')
      File "c:\users\charles\appdata\local\programs\python\python37\lib\distutils\cmd.py", line 313, in run_command
        self.distribution.run_command(command)
      File "c:\users\charles\appdata\local\programs\python\python37\lib\distutils\dist.py", line 985, in run_command
        cmd_obj.run()
      File "c:\users\charles\appdata\local\programs\python\python37\lib\distutils\command\build.py", line 135, in run
        self.run_command(cmd_name)
      File "c:\users\charles\appdata\local\programs\python\python37\lib\distutils\cmd.py", line 313, in run_command
        self.distribution.run_command(command)
      File "c:\users\charles\appdata\local\programs\python\python37\lib\distutils\dist.py", line 985, in run_command
        cmd_obj.run()
      File "C:\Users\Charles\AppData\Local\Temp\pip-install-6wd_c0pw\dlib\setup.py", line 135, in run
        self.build_extension(ext)
      File "C:\Users\Charles\AppData\Local\Temp\pip-install-6wd_c0pw\dlib\setup.py", line 172, in build_extension
        subprocess.check_call(cmake_setup, cwd=build_folder)
      File "c:\users\charles\appdata\local\programs\python\python37\lib\subprocess.py", line 347, in check_call
        raise CalledProcessError(retcode, cmd)
    subprocess.CalledProcessError: Command '['cmake', 'C:\\Users\\Charles\\AppData\\Local\\Temp\\pip-install-6wd_c0pw\\dlib\\tools\\python', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\\Users\\Charles\\AppData\\Local\\Temp\\pip-install-6wd_c0pw\\dlib\\build\\lib.win-amd64-3.7', '-DPYTHON_EXECUTABLE=c:\\users\\charles\\appdata\\local\\programs\\python\\python37\\python.exe', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\\Users\\Charles\\AppData\\Local\\Temp\\pip-install-6wd_c0pw\\dlib\\build\\lib.win-amd64-3.7', '-A', 'x64']' returned non-zero exit status 1.
    ----------------------------------------
ERROR: Command errored out with exit status 1: 'c:\users\charles\appdata\local\programs\python\python37\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Charles\\AppData\\Local\\Temp\\pip-install-6wd_c0pw\\dlib\\setup.py'"'"'; __file__='"'"'C:\\Users\\Charles\\AppData\\Local\\Temp\\pip-install-6wd_c0pw\\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\Charles\AppData\Local\Temp\pip-record-xchasbrx\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\users\charles\appdata\local\programs\python\python37\Include\dlib' Check the logs for full command output.

я также установлен это :

  1. go здесь https://pypi.org/simple/dlib/
  2. pick dlib-19.18.0.tar.gz
  3. извлечь его и go в папка
  4. откройте командную строку и запустите python setup.py install

it вернет :

running install
running bdist_egg
running egg_info
writing dlib.egg-info\PKG-INFO
writing dependency_links to dlib.egg-info\dependency_links.txt
writing top-level names to dlib.egg-info\top_level.txt
package init file 'dlib\__init__.py' not found (or not a regular file)
reading manifest file 'dlib.egg-info\SOURCES.txt'
reading manifest template 'MANIFEST.in'
no previously-included directories found matching 'tools\python\build*'
no previously-included directories found matching 'dlib\test'
writing manifest file 'dlib.egg-info\SOURCES.txt'
installing library code to build\bdist.win-amd64\egg
running install_lib
running build_py
running build_ext
Building extension for Python 3.7.4 (tags/v3.7.4:e09359112e, Jul  8 2019, 20:34:20) [MSC v.1916 64 bit (AMD64)]
Invoking CMake setup: 'cmake C:\Users\Charles\Downloads\dlib-19.18.0.tar\dist\dlib-19.18.0\tools\python -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\Users\Charles\Downloads\dlib-19.18.0.tar\dist\dlib-19.18.0\build\lib.win-amd64-3.7 -DPYTHON_EXECUTABLE=C:\Users\Charles\AppData\Local\Programs\Python\Python37\python.exe -DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\Users\Charles\Downloads\dlib-19.18.0.tar\dist\dlib-19.18.0\build\lib.win-amd64-3.7 -A x64'
CMake Error at CMakeLists.txt:3 (project):
  Failed to run MSBuild command:

    C:/Windows/Microsoft.NET/Framework/v4.0.30319/MSBuild.exe

  to get the value of VCTargetsPath:

    Microsoft (R) Build Engine version 4.8.3752.0
    [Microsoft .NET Framework, version 4.0.30319.42000]
    Copyright (C) Microsoft Corporation. All rights reserved.

    Build started 2/7/2020 12:21:15 PM.
    Project "C:\Users\Charles\Downloads\dlib-19.18.0.tar\dist\dlib-19.18.0\build\temp.win-amd64-3.7\Release\CMakeFiles\3.16.3\VCTargetsPath.vcxproj" on node 1 (default targets).
    C:\Users\Charles\Downloads\dlib-19.18.0.tar\dist\dlib-19.18.0\build\temp.win-amd64-3.7\Release\CMakeFiles\3.16.3\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\Charles\Downloads\dlib-19.18.0.tar\dist\dlib-19.18.0\build\temp.win-amd64-3.7\Release\CMakeFiles\3.16.3\VCTargetsPath.vcxproj" (default targets) -- FAILED.

    Build FAILED.

    "C:\Users\Charles\Downloads\dlib-19.18.0.tar\dist\dlib-19.18.0\build\temp.win-amd64-3.7\Release\CMakeFiles\3.16.3\VCTargetsPath.vcxproj" (default target) (1) ->
      C:\Users\Charles\Downloads\dlib-19.18.0.tar\dist\dlib-19.18.0\build\temp.win-amd64-3.7\Release\CMakeFiles\3.16.3\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.06


  Exit code: 1



-- Configuring incomplete, errors occurred!
See also "C:/Users/Charles/Downloads/dlib-19.18.0.tar/dist/dlib-19.18.0/build/temp.win-amd64-3.7/Release/CMakeFiles/CMakeOutput.log".
Traceback (most recent call last):
  File "setup.py", line 261, in <module>
    'Topic :: Software Development',
  File "C:\Users\Charles\AppData\Local\Programs\Python\Python37\lib\site-packages\setuptools\__init__.py", line 145, in setup
    return distutils.core.setup(**attrs)
  File "C:\Users\Charles\AppData\Local\Programs\Python\Python37\lib\distutils\core.py", line 148, in setup
    dist.run_commands()
  File "C:\Users\Charles\AppData\Local\Programs\Python\Python37\lib\distutils\dist.py", line 966, in run_commands
    self.run_command(cmd)
  File "C:\Users\Charles\AppData\Local\Programs\Python\Python37\lib\distutils\dist.py", line 985, in run_command
    cmd_obj.run()
  File "C:\Users\Charles\AppData\Local\Programs\Python\Python37\lib\site-packages\setuptools\command\install.py", line 67, in run
    self.do_egg_install()
  File "C:\Users\Charles\AppData\Local\Programs\Python\Python37\lib\site-packages\setuptools\command\install.py", line 109, in do_egg_install
    self.run_command('bdist_egg')
  File "C:\Users\Charles\AppData\Local\Programs\Python\Python37\lib\distutils\cmd.py", line 313, in run_command
    self.distribution.run_command(command)
  File "C:\Users\Charles\AppData\Local\Programs\Python\Python37\lib\distutils\dist.py", line 985, in run_command
    cmd_obj.run()
  File "C:\Users\Charles\AppData\Local\Programs\Python\Python37\lib\site-packages\setuptools\command\bdist_egg.py", line 172, in run
    cmd = self.call_command('install_lib', warn_dir=0)
  File "C:\Users\Charles\AppData\Local\Programs\Python\Python37\lib\site-packages\setuptools\command\bdist_egg.py", line 158, in call_command
    self.run_command(cmdname)
  File "C:\Users\Charles\AppData\Local\Programs\Python\Python37\lib\distutils\cmd.py", line 313, in run_command
    self.distribution.run_command(command)
  File "C:\Users\Charles\AppData\Local\Programs\Python\Python37\lib\distutils\dist.py", line 985, in run_command
    cmd_obj.run()
  File "C:\Users\Charles\AppData\Local\Programs\Python\Python37\lib\site-packages\setuptools\command\install_lib.py", line 11, in run
    self.build()
  File "C:\Users\Charles\AppData\Local\Programs\Python\Python37\lib\distutils\command\install_lib.py", line 107, in build
    self.run_command('build_ext')
  File "C:\Users\Charles\AppData\Local\Programs\Python\Python37\lib\distutils\cmd.py", line 313, in run_command
    self.distribution.run_command(command)
  File "C:\Users\Charles\AppData\Local\Programs\Python\Python37\lib\distutils\dist.py", line 985, in run_command
    cmd_obj.run()
  File "setup.py", line 135, in run
    self.build_extension(ext)
  File "setup.py", line 172, in build_extension
    subprocess.check_call(cmake_setup, cwd=build_folder)
  File "C:\Users\Charles\AppData\Local\Programs\Python\Python37\lib\subprocess.py", line 347, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', 'C:\\Users\\Charles\\Downloads\\dlib-19.18.0.tar\\dist\\dlib-19.18.0\\tools\\python', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\\Users\\Charles\\Downloads\\dlib-19.18.0.tar\\dist\\dlib-19.18.0\\build\\lib.win-amd64-3.7', '-DPYTHON_EXECUTABLE=C:\\Users\\Charles\\AppData\\Local\\Programs\\Python\\Python37\\python.exe', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\\Users\\Charles\\Downloads\\dlib-19.18.0.tar\\dist\\dlib-19.18.0\\build\\lib.win-amd64-3.7', '-A', 'x64']' returned non-zero exit status 1.

я также пытался установить его из источника как:

python -m pip install  https://files.pythonhosted.org/packages/1e/62/aacb236d21fbd08148b1d517d58a9d80ea31bdcd386d26f21f8b23b1eb28/dlib-19.18.0.tar.gz#sha256=8ca127253a0ca82a3d847148515f82ff2c504ed77a6385ec4f38c7f8e5360860

он возвращает ошибку как

Collecting https://files.pythonhosted.org/packages/1e/62/aacb236d21fbd08148b1d517d58a9d80ea31bdcd386d26f21f8b23b1eb28/dlib-19.18.0.tar.gz#sha256=8ca127253a0ca82a3d847148515f82ff2c504ed77a6385ec4f38c7f8e5360860
  Using cached dlib-19.18.0.tar.gz (3.1 MB)
Installing collected packages: dlib
    Running setup.py install for dlib ... error
    ERROR: Command errored out with exit status 1:
     command: 'C:\Users\Charles\AppData\Local\Programs\Python\Python37\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Charles\\AppData\\Local\\Temp\\pip-req-build-k3302dt_\\setup.py'"'"'; __file__='"'"'C:\\Users\\Charles\\AppData\\Local\\Temp\\pip-req-build-k3302dt_\\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\Charles\AppData\Local\Temp\pip-record-waso8gw6\install-record.txt' --single-version-externally-managed --compile --install-headers 'C:\Users\Charles\AppData\Local\Programs\Python\Python37\Include\dlib'
         cwd: C:\Users\Charles\AppData\Local\Temp\pip-req-build-k3302dt_\
    Complete output (74 lines):
    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.7.4 (tags/v3.7.4:e09359112e, Jul  8 2019, 20:34:20) [MSC v.1916 64 bit (AMD64)]
    Invoking CMake setup: 'cmake C:\Users\Charles\AppData\Local\Temp\pip-req-build-k3302dt_\tools\python -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\Users\Charles\AppData\Local\Temp\pip-req-build-k3302dt_\build\lib.win-amd64-3.7 -DPYTHON_EXECUTABLE=C:\Users\Charles\AppData\Local\Programs\Python\Python37\python.exe -DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\Users\Charles\AppData\Local\Temp\pip-req-build-k3302dt_\build\lib.win-amd64-3.7 -A x64'
    -- Building for: Visual Studio 10 2010
    CMake Error at CMakeLists.txt:3 (project):
      Failed to run MSBuild command:

        C:/Windows/Microsoft.NET/Framework/v4.0.30319/MSBuild.exe

      to get the value of VCTargetsPath:

        Microsoft (R) Build Engine version 4.8.3752.0
        [Microsoft .NET Framework, version 4.0.30319.42000]
        Copyright (C) Microsoft Corporation. All rights reserved.

        Build started 2/7/2020 12:53:19 PM.
        Project "C:\Users\Charles\AppData\Local\Temp\pip-req-build-k3302dt_\build\temp.win-amd64-3.7\Release\CMakeFiles\3.16.3\VCTargetsPath.vcxproj" on node 1 (default targets).
        C:\Users\Charles\AppData\Local\Temp\pip-req-build-k3302dt_\build\temp.win-amd64-3.7\Release\CMakeFiles\3.16.3\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\Charles\AppData\Local\Temp\pip-req-build-k3302dt_\build\temp.win-amd64-3.7\Release\CMakeFiles\3.16.3\VCTargetsPath.vcxproj" (default targets) -- FAILED.

        Build FAILED.

        "C:\Users\Charles\AppData\Local\Temp\pip-req-build-k3302dt_\build\temp.win-amd64-3.7\Release\CMakeFiles\3.16.3\VCTargetsPath.vcxproj" (default target) (1) ->
          C:\Users\Charles\AppData\Local\Temp\pip-req-build-k3302dt_\build\temp.win-amd64-3.7\Release\CMakeFiles\3.16.3\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.01


      Exit code: 1



    -- Configuring incomplete, errors occurred!
    See also "C:/Users/Charles/AppData/Local/Temp/pip-req-build-k3302dt_/build/temp.win-amd64-3.7/Release/CMakeFiles/CMakeOutput.log".
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "C:\Users\Charles\AppData\Local\Temp\pip-req-build-k3302dt_\setup.py", line 261, in <module>
        'Topic :: Software Development',
      File "C:\Users\Charles\AppData\Local\Programs\Python\Python37\lib\site-packages\setuptools\__init__.py", line 145, in setup
        return distutils.core.setup(**attrs)
      File "C:\Users\Charles\AppData\Local\Programs\Python\Python37\lib\distutils\core.py", line 148, in setup
        dist.run_commands()
      File "C:\Users\Charles\AppData\Local\Programs\Python\Python37\lib\distutils\dist.py", line 966, in run_commands
        self.run_command(cmd)
      File "C:\Users\Charles\AppData\Local\Programs\Python\Python37\lib\distutils\dist.py", line 985, in run_command
        cmd_obj.run()
      File "C:\Users\Charles\AppData\Local\Programs\Python\Python37\lib\site-packages\setuptools\command\install.py", line 61, in run
        return orig.install.run(self)
      File "C:\Users\Charles\AppData\Local\Programs\Python\Python37\lib\distutils\command\install.py", line 545, in run
        self.run_command('build')
      File "C:\Users\Charles\AppData\Local\Programs\Python\Python37\lib\distutils\cmd.py", line 313, in run_command
        self.distribution.run_command(command)
      File "C:\Users\Charles\AppData\Local\Programs\Python\Python37\lib\distutils\dist.py", line 985, in run_command
        cmd_obj.run()
      File "C:\Users\Charles\AppData\Local\Programs\Python\Python37\lib\distutils\command\build.py", line 135, in run
        self.run_command(cmd_name)
      File "C:\Users\Charles\AppData\Local\Programs\Python\Python37\lib\distutils\cmd.py", line 313, in run_command
        self.distribution.run_command(command)
      File "C:\Users\Charles\AppData\Local\Programs\Python\Python37\lib\distutils\dist.py", line 985, in run_command
        cmd_obj.run()
      File "C:\Users\Charles\AppData\Local\Temp\pip-req-build-k3302dt_\setup.py", line 135, in run
        self.build_extension(ext)
      File "C:\Users\Charles\AppData\Local\Temp\pip-req-build-k3302dt_\setup.py", line 172, in build_extension
        subprocess.check_call(cmake_setup, cwd=build_folder)
      File "C:\Users\Charles\AppData\Local\Programs\Python\Python37\lib\subprocess.py", line 347, in check_call
        raise CalledProcessError(retcode, cmd)
    subprocess.CalledProcessError: Command '['cmake', 'C:\\Users\\Charles\\AppData\\Local\\Temp\\pip-req-build-k3302dt_\\tools\\python', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\\Users\\Charles\\AppData\\Local\\Temp\\pip-req-build-k3302dt_\\build\\lib.win-amd64-3.7', '-DPYTHON_EXECUTABLE=C:\\Users\\Charles\\AppData\\Local\\Programs\\Python\\Python37\\python.exe', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\\Users\\Charles\\AppData\\Local\\Temp\\pip-req-build-k3302dt_\\build\\lib.win-amd64-3.7', '-A', 'x64']' returned non-zero exit status 1.
    ----------------------------------------
ERROR: Command errored out with exit status 1: 'C:\Users\Charles\AppData\Local\Programs\Python\Python37\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Charles\\AppData\\Local\\Temp\\pip-req-build-k3302dt_\\setup.py'"'"'; __file__='"'"'C:\\Users\\Charles\\AppData\\Local\\Temp\\pip-req-build-k3302dt_\\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\Charles\AppData\Local\Temp\pip-record-waso8gw6\install-record.txt' --single-version-externally-managed --compile --install-headers 'C:\Users\Charles\AppData\Local\Programs\Python\Python37\Include\dlib' Check the logs for full command output.

Я так потерян, любые ответы или предложения будут оценены так много. Спасибо

Ответы [ 3 ]

1 голос
/ 07 февраля 2020

Решено путем установки VS с C ++.

1 голос
/ 07 февраля 2020

Вы сами это выяснили, но я хотел бы добавить несколько замечаний о ваших методах установки:

pip install dlib

Так как на pypi есть только tar.gz, он загружает его и затем пытается запустить setup.py после установки требований

Таким образом, вы вручную делаете tar.gz, извлекаете его и запускаете python setup.py install - это то же самое, что и первая команда, а также

python -m pip install  https://files.pythonhosted.org/packages/1e/62/aacb236d21fbd08148b1d517d58a9d80ea31bdcd386d26f21f8b23b1eb28/dlib-19.18.0.tar.gz

Is делая то же самое в конце, пытаясь запустить setup.py для установки.

В этом случае это включает в себя компиляцию кода c / c ++, который требует установки правильных инструментов компилятора / сборки, которые pip не может заботиться о. Он не предназначен для этой задачи.

0 голосов
/ 07 февраля 2020
  1. Python 3,6 (64 бита) уже должен быть установлен.
  2. Выполнить Windows Команда подсказки. Вы можете ввести в строке поиска «CMD». Не забудьте щелкнуть правой кнопкой мыши, а затем «Запустить ее от имени администратора», иначе у вас может не быть разрешения на установку библиотеки.
  3. Введите в командной строке команду

python -m pip install https://files.pythonhosted.org/packages/0e/ce/f8a3cff33ac03a8219768f0694c5d703c8e037e6aba2e865f9bae22ed63c/dlib-19.8.1-cp36-cp36m-win_amd64.whl#sha256 = 794994fa2c54e7776659fddb148363a5556468a6d5d46be8dad311722d54bfcf 4. Как только вы увидите сообщение «Успешно установлена ​​dlib», это означает, что завершено

...