не удается установить Dlib на Windows 10

0

Попытка установить dlib на Windows 10 с помощью диспетчера пакетов pycharm. У меня есть Numpy, opencv-python, setuptools и установленное колесо. попробовал установить dlib, а затем получил первую ошибку с просьбой установить CMake.

Теперь я получаю это: (попытался установить визуальную студию, но это не повлияло).

    Collecting dlib   Using cached https://files.pythonhosted.org/packages/d5/5c/aa64510aa354d562ecba7edecd500b020280741140e5d91ff5ec1c6f8289/dlib-19.13.1.tar.gz Building wheels for collected packages: dlib   Running setup.py bdist_wheel for dlib: started   Running setup.py bdist_wheel for dlib: finished with status 'error'   Complete output from command C:\Users\Tom\venv\Scripts\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\Tom\\AppData\\Local\\Temp\\pycharm-packaging\\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\Tom\AppData\Local\Temp\pip-wheel-f_njkl2_ --python-tag cp36:  running bdist_wheel   running build   running build_py   package init file 'dlib\__init__.py' not found (or not a regular file)   warning: build_py: byte-compiling is disabled, skipping.
     running build_ext   Building extension for Python 3.6.5 (v3.6.5:f59c0932b4, Mar 28 2018, 16:07:46) [MSC v.1900 32 bit (Intel)] Invoking CMake setup: 'cmake C:\Users\Tom\AppData\Local\Temp\pycharm-packaging\dlib\tools\python
-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\Users\Tom\AppData\Local\Temp\pycharm-packaging\dlib\build\lib.win32-3.6
-DPYTHON_EXECUTABLE=C:\Users\Tom\venv\Scripts\python.exe -DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\Users\Tom\AppData\Local\Temp\pycharm-packaging\dlib\build\lib.win32-3.6'
-- 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/Tom/AppData/Local/Temp/pycharm-packaging/dlib/build/temp.win32-3.6/Release/CMakeFiles/CMakeOutput.log". See also "C:/Users/Tom/AppData/Local/Temp/pycharm-packaging/dlib/build/temp.win32-3.6/Release/CMakeFiles/CMakeError.log". Traceback (most recent call last):
    File "<string>", line 1, in <module>
    File "C:\Users\Tom\AppData\Local\Temp\pycharm-packaging\dlib\setup.py", line 256, in <module>
      'Topic :: Software Development',
    File "C:\Users\Tom\venv\lib\site-packages\setuptools-39.1.0-py3.6.egg\setuptools\__init__.py", line 129, in setup
    File "C:\Users\Tom\AppData\Local\Programs\Python\Python36-32\lib\distutils\core.py", line 148, in setup
      dist.run_commands()
    File "C:\Users\Tom\AppData\Local\Programs\Python\Python36-32\lib\distutils\dist.py", line 955, in run_commands
      self.run_command(cmd)
    File "C:\Users\Tom\AppData\Local\Programs\Python\Python36-32\lib\distutils\dist.py", line 974, in run_command
      cmd_obj.run()
    File "C:\Users\Tom\venv\lib\site-packages\wheel\bdist_wheel.py", line 202, in run
      self.run_command('build')
    File "C:\Users\Tom\AppData\Local\Programs\Python\Python36-32\lib\distutils\cmd.py", line 313, in run_command
      self.distribution.run_command(command)
    File "C:\Users\Tom\AppData\Local\Programs\Python\Python36-32\lib\distutils\dist.py", line 974, in run_command
      cmd_obj.run()
    File "C:\Users\Tom\AppData\Local\Programs\Python\Python36-32\lib\distutils\command\build.py", line 135, in run
      self.run_command(cmd_name)
    File "C:\Users\Tom\AppData\Local\Programs\Python\Python36-32\lib\distutils\cmd.py", line 313, in run_command
      self.distribution.run_command(command)
    File "C:\Users\Tom\AppData\Local\Programs\Python\Python36-32\lib\distutils\dist.py", line 974, in run_command
      cmd_obj.run()
    File "C:\Users\Tom\AppData\Local\Temp\pycharm-packaging\dlib\setup.py", line 133, in run
      self.build_extension(ext)
    File "C:\Users\Tom\AppData\Local\Temp\pycharm-packaging\dlib\setup.py", line 169, in build_extension
      subprocess.check_call(cmake_setup, cwd=build_folder)
    File "C:\Users\Tom\AppData\Local\Programs\Python\Python36-32\lib\subprocess.py", line 291, in check_call
      raise CalledProcessError(retcode, cmd)   subprocess.CalledProcessError: Command '['cmake', 'C:\\Users\\Tom\\AppData\\Local\\Temp\\pycharm-packaging\\dlib\\tools\\python', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\\Users\\Tom\\AppData\\Local\\Temp\\pycharm-packaging\\dlib\\build\\lib.win32-3.6', '-DPYTHON_EXECUTABLE=C:\\Users\\Tom\\venv\\Scripts\\python.exe', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\\Users\\Tom\\AppData\\Local\\Temp\\pycharm-packaging\\dlib\\build\\lib.win32-3.6']' returned non-zero exit status 1.
     ----------------------------------------   Running setup.py clean for dlib Failed to build dlib Installing collected packages: dlib   Running setup.py install for dlib: started
    Running setup.py install for dlib: finished with status 'error'
    Complete output from command C:\Users\Tom\venv\Scripts\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\Tom\\AppData\\Local\\Temp\\pycharm-packaging\\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\Tom\AppData\Local\Temp\pip-record-1kold5c8\install-record.txt
--single-version-externally-managed --compile --install-headers C:\Users\Tom\venv\include\site\python3.6\dlib:
    running install
    running build
    running build_py
    package init file 'dlib\__init__.py' not found (or not a regular file)
    warning: build_py: byte-compiling is disabled, skipping.

    running build_ext
    Building extension for Python 3.6.5 (v3.6.5:f59c0932b4, Mar 28 2018, 16:07:46) [MSC v.1900 32 bit (Intel)]
    Invoking CMake setup: 'cmake C:\Users\Tom\AppData\Local\Temp\pycharm-packaging\dlib\tools\python
-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\Users\Tom\AppData\Local\Temp\pycharm-packaging\dlib\build\lib.win32-3.6
-DPYTHON_EXECUTABLE=C:\Users\Tom\venv\Scripts\python.exe -DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\Users\Tom\AppData\Local\Temp\pycharm-packaging\dlib\build\lib.win32-3.6'
    -- 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/Tom/AppData/Local/Temp/pycharm-packaging/dlib/build/temp.win32-3.6/Release/CMakeFiles/CMakeOutput.log".
    See also "C:/Users/Tom/AppData/Local/Temp/pycharm-packaging/dlib/build/temp.win32-3.6/Release/CMakeFiles/CMakeError.log".
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "C:\Users\Tom\AppData\Local\Temp\pycharm-packaging\dlib\setup.py", line 256, in <module>
        'Topic :: Software Development',
      File "C:\Users\Tom\venv\lib\site-packages\setuptools-39.1.0-py3.6.egg\setuptools\__init__.py", line 129, in setup
      File "C:\Users\Tom\AppData\Local\Programs\Python\Python36-32\lib\distutils\core.py", line 148, in setup
        dist.run_commands()
      File "C:\Users\Tom\AppData\Local\Programs\Python\Python36-32\lib\distutils\dist.py", line 955, in run_commands
        self.run_command(cmd)
      File "C:\Users\Tom\AppData\Local\Programs\Python\Python36-32\lib\distutils\dist.py", line 974, in run_command
        cmd_obj.run()
      File "C:\Users\Tom\venv\lib\site-packages\setuptools-39.1.0-py3.6.egg\setuptools\command\install.py", line 61, in run
      File "C:\Users\Tom\AppData\Local\Programs\Python\Python36-32\lib\distutils\command\install.py", line 545, in run
        self.run_command('build')
      File "C:\Users\Tom\AppData\Local\Programs\Python\Python36-32\lib\distutils\cmd.py", line 313, in run_command
        self.distribution.run_command(command)
      File "C:\Users\Tom\AppData\Local\Programs\Python\Python36-32\lib\distutils\dist.py", line 974, in run_command
        cmd_obj.run()
      File "C:\Users\Tom\AppData\Local\Programs\Python\Python36-32\lib\distutils\command\build.py", line 135, in run
        self.run_command(cmd_name)
      File "C:\Users\Tom\AppData\Local\Programs\Python\Python36-32\lib\distutils\cmd.py", line 313, in run_command
        self.distribution.run_command(command)
      File "C:\Users\Tom\AppData\Local\Programs\Python\Python36-32\lib\distutils\dist.py", line 974, in run_command
        cmd_obj.run()
      File "C:\Users\Tom\AppData\Local\Temp\pycharm-packaging\dlib\setup.py", line 133, in run
        self.build_extension(ext)
      File "C:\Users\Tom\AppData\Local\Temp\pycharm-packaging\dlib\setup.py", line 169, in build_extension
        subprocess.check_call(cmake_setup, cwd=build_folder)
      File "C:\Users\Tom\AppData\Local\Programs\Python\Python36-32\lib\subprocess.py", line 291, in check_call
        raise CalledProcessError(retcode, cmd)
    subprocess.CalledProcessError: Command '['cmake', 'C:\\Users\\Tom\\AppData\\Local\\Temp\\pycharm-packaging\\dlib\\tools\\python', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\\Users\\Tom\\AppData\\Local\\Temp\\pycharm-packaging\\dlib\\build\\lib.win32-3.6', '-DPYTHON_EXECUTABLE=C:\\Users\\Tom\\venv\\Scripts\\python.exe', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\\Users\\Tom\\AppData\\Local\\Temp\\pycharm-packaging\\dlib\\build\\lib.win32-3.6']' returned non-zero exit status 1.

    ----------------------------------------

  Failed building wheel for dlib Command "C:\Users\Tom\venv\Scripts\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\Tom\\AppData\\Local\\Temp\\pycharm-packaging\\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\Tom\AppData\Local\Temp\pip-record-1kold5c8\install-record.txt
--single-version-externally-managed --compile --install-headers C:\Users\Tom\venv\include\site\python3.6\dlib" failed with error code 1 in C:\Users\Tom\AppData\Local\Temp\pycharm-packaging\dlib\

Что мне здесь не хватает? Я действительно озадачен.

Теги:
dlib
pycharm

6 ответов

3

pip install https://pypi.python.org/packages/da/06/bd3e241c4eb0a662914b3b4875fc52dd176a9db0d4a2c915ac2ad8800e9e/dlib-19.7.0-cp36-cp36m-win_amd64.whl#md5=b7330a5b2d46420343fbed5df69e6a3f

Попробуйте эту команду cmd, это сработало для меня

  • 1
    Огромное спасибо. Это первое, с чего я начал работать, и я следовал инструкциям learnopencv и попробовал несколько версий dlib (установленные зависимости, такие как cmake и т. Д.).
0

Я знаю, что этот вопрос для Windows, но случайно, если кто-то ищет решение для этого на Mac,

Попробуйте эту команду, у меня сработало

pip install https://files.pythonhosted.org/packages/05/57/e8a8caa3c89a27f80bc78da39c423e2553f482a3705adc619176a3a24b36/dlib-19.17.0.tar.gz#SHA256=92587c81b0165d900ff086f5990958958808808778

0

Лучший способ установить dlib и openCV приведен здесь.

Он просто использует pip для выполнения всех установок. Основные вещи, по которым люди пропускают или делают ошибку для Windows, - это объявление переменных PATH и сохранение их по правильному адресу на вашем компьютере, кроме правильного соответствия версии. В приведенном выше блоге четко указаны используемые версии и объявления переменных PATH.

Всего 3 этапа: -

  1. Установить anaconda
  2. Активировать виртуальную среду
  3. Установите openCV и dlib с помощью pip (или любых других необходимых пакетов)
  • 0
    Пожалуйста, укажите основные пункты предоставленной ссылки на ваш ответ.
0

Я следовал ниже шаги для установки face_recognition (dlib): -

  1. Переустановил Python 3.6.6 (https://www.python.org/ftp/python/3.6.6/python-3.6.6-amd64.exe).

  2. pip3 установить cmake

  3. pip3 установить dlib

  4. pip3 установить face_recognition

Это сработало для меня.

0

Используйте следующий код в терминале, который доступен через Alt + F12 на клавиатуре.

pip install dlib==19.8.1

Тебе должно быть хорошо.

0

Ошибка сообщает вам ответ. 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)."

Попробуйте выполнить компиляцию с помощью командной строки Visual Studio. Путь к нему там тоже должен быть правильным.

Ещё вопросы

Сообщество Overcoder
Наверх
Меню