Building wheel for dlib setup py error

Hello i'm trying to install dlib using pip install dlibbut i get an error. This is the error: G:Gedeelde drives4TW_2022-2023_T1(Lucas-Bram-Senne)2. Persoonlijk2. Lucas NTest gezichtsherken...

Hello i’m trying to install dlib using pip install dlibbut i get an error.

G:Gedeelde drives4TW_2022-2023_T1(Lucas-Bram-Senne)2. Persoonlijk2. Lucas NTest gezichtsherkenningTest>pip install dlib
Collecting dlib
  Using cached dlib-19.24.0.tar.gz (3.2 MB)
  Preparing metadata (setup.py) ... done
Building wheels for collected packages: dlib
  Building wheel for dlib (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> [8 lines of output]
      running bdist_wheel
      running build
      running build_py
      package init file 'toolspythondlib__init__.py' not found (or not a regular file)
      running build_ext

      ERROR: CMake must be installed to build dlib

      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: 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
  error: subprocess-exited-with-error

  × Running setup.py install for dlib did not run successfully.
  │ exit code: 1
  ╰─> [8 lines of output]
      running install
      running build
      running build_py
      package init file 'toolspythondlib__init__.py' not found (or not a regular file)
      running build_ext

      ERROR: CMake must be installed to build dlib

      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure

× Encountered error while trying to install package.
╰─> dlib

note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.

i’am using python 3.8.2
I got dlib automaticly using pip install dlib
i’am using windows 10 64 bit

I am trying to install face_recognition on Ubuntu.

I keep running into this loop, which goes on forever. Please help.

pip install face_recognition
Collecting face_recognition
  Using cached https://files.pythonhosted.org/packages/3f/ed/ad9a28042f373d4633fc8b49109b623597d6f193d3bbbef7780a5ee8eef2/face_recognition-1.2.3-py2.py3-none-any.whl
Collecting Pillow (from face_recognition)
  Using cached https://files.pythonhosted.org/packages/c1/e6/ce127fa0ac17775bc7887c432ffe945c49ae141f01b477b7cd5e63b16bb5/Pillow-6.0.0-cp37-cp37m-manylinux1_x86_64.whl
Requirement already satisfied: numpy in ./.virtualenvs/cv/lib/python3.7/site-packages (from face_recognition) (1.16.3)
Collecting Click>=6.0 (from face_recognition)
  Using cached https://files.pythonhosted.org/packages/fa/37/45185cb5abbc30d7257104c434fe0b07e5a195a6847506c074527aa599ec/Click-7.0-py2.py3-none-any.whl
Collecting face-recognition-models>=0.3.0 (from face_recognition)
Collecting dlib>=19.7 (from face_recognition)
  Using cached https://files.pythonhosted.org/packages/05/57/e8a8caa3c89a27f80bc78da39c423e2553f482a3705adc619176a3a24b36/dlib-19.17.0.tar.gz
Building wheels for collected packages: dlib
  Building wheel for dlib (setup.py) .

eyllanesc's user avatar

eyllanesc

230k18 gold badges147 silver badges218 bronze badges

asked May 9, 2019 at 2:47

mshahiddev's user avatar

6

Add -vvv to see if the installation is progressing.

I also was in that loop, it took a long time but it finished.

pip install dlib -vvv

answered Jun 5, 2020 at 0:02

Evandro Pomatti's user avatar

Evandro PomattiEvandro Pomatti

11.8k15 gold badges88 silver badges150 bronze badges

this is my step-by-step solution

    apt-get update
    apt-get install build-essential cmake
    apt-get install libopenblas-dev liblapack-dev 
    apt-get install libx11-dev libgtk-3-dev
    apt-get install python python-dev python-pip
    apt-get install python3 python3-dev python3-pip

then install dlib

    cd ~
    mkdir temp
    cd temp
    git clone https://github.com/davisking/dlib.git
    cd dlib
    mkdir build; cd build; cmake ..; cmake --build .
    cd ..
    python3 setup.py install

then install face_recognition

    pip3 install numpy scipy matplotlib pandas face_recognition

answered Nov 21, 2019 at 8:57

Suvier's user avatar

Although I don’t know the cause of the loop, I found a workaround by creating a (Anaconda) container with python version 3.6.9 (whereas at first I tried to install face_recognition with python version 3.7.3. Hope it helps.

answered Nov 14, 2019 at 23:16

Erientes's user avatar

0

I tried a lot to install pip install dlib but it always shows an error and I reinstalled cmake.

pip install dlib
Collecting dlib
  Using cached https://files.pythonhosted.org/packages/1e/62/aacb236d21fbd08148b1d517d58a9d80ea31bdcd386d26f21f8b23b1eb28/dlib-19.18.0.tar.gz
Building wheels for collected packages: dlib
  Building wheel for dlib (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: 'c:program filespython37python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:UsershpAppDataLocalTemppip-install-yynf7muedlibsetup.py'"'"'; __file__='"'"'C:UsershpAppDataLocalTemppip-install-yynf7muedlibsetup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'rn'"'"', '"'"'n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d 'C:UsershpAppDataLocalTemppip-wheel-0eyy_3vd' --python-tag cp37
       cwd: C:UsershpAppDataLocalTemppip-install-yynf7muedlib
  Complete output (55 lines):
  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.7.4 (tags/v3.7.4:e09359112e, Jul  8 2019, 20:34:20) [MSC v.1916 64 bit (AMD64)]
  Invoking CMake setup: 'cmake C:UsershpAppDataLocalTemppip-install-yynf7muedlibtoolspython -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:UsershpAppDataLocalTemppip-install-yynf7muedlibbuildlib.win-amd64-3.7 -DPYTHON_EXECUTABLE=c:program filespython37python.exe -DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:UsershpAppDataLocalTemppip-install-yynf7muedlibbuildlib.win-amd64-3.7 -A x64'
  -- Building for: NMake Makefiles
  CMake Error at CMakeLists.txt:3 (project):
    Generator

      NMake Makefiles

    does not support platform specification, but platform

      x64

    was specified.


  CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
  CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
  -- Configuring incomplete, errors occurred!
  See also "C:/Users/hp/AppData/Local/Temp/pip-install-yynf7mue/dlib/build/temp.win-amd64-3.7/Release/CMakeFiles/CMakeOutput.log".
  Traceback (most recent call last):
    File "<string>", line 1, in <module>
    File "C:UsershpAppDataLocalTemppip-install-yynf7muedlibsetup.py", line 261, in <module>
      'Topic :: Software Development',
    File "c:program filespython37libsite-packagessetuptools__init__.py", line 145, in setup
      return distutils.core.setup(**attrs)
    File "c:program filespython37libdistutilscore.py", line 148, in setup
      dist.run_commands()
    File "c:program filespython37libdistutilsdist.py", line 966, in run_commands
      self.run_command(cmd)
    File "c:program filespython37libdistutilsdist.py", line 985, in run_command
      cmd_obj.run()
    File "c:program filespython37libsite-packageswheelbdist_wheel.py", line 192, in run
      self.run_command('build')
    File "c:program filespython37libdistutilscmd.py", line 313, in run_command
      self.distribution.run_command(command)
    File "c:program filespython37libdistutilsdist.py", line 985, in run_command
      cmd_obj.run()
    File "c:program filespython37libdistutilscommandbuild.py", line 135, in run
      self.run_command(cmd_name)
    File "c:program filespython37libdistutilscmd.py", line 313, in run_command
      self.distribution.run_command(command)
    File "c:program filespython37libdistutilsdist.py", line 985, in run_command
      cmd_obj.run()
    File "C:UsershpAppDataLocalTemppip-install-yynf7muedlibsetup.py", line 135, in run
      self.build_extension(ext)
    File "C:UsershpAppDataLocalTemppip-install-yynf7muedlibsetup.py", line 172, in build_extension
      subprocess.check_call(cmake_setup, cwd=build_folder)
    File "c:program filespython37libsubprocess.py", line 347, in check_call
      raise CalledProcessError(retcode, cmd)
  subprocess.CalledProcessError: Command '['cmake', 'C:UsershpAppDataLocalTemppip-install-yynf7muedlibtoolspython', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:UsershpAppDataLocalTemppip-install-yynf7muedlibbuildlib.win-amd64-3.7', '-DPYTHON_EXECUTABLE=c:program filespython37python.exe', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:UsershpAppDataLocalTemppip-install-yynf7muedlibbuildlib.win-amd64-3.7', '-A', 'x64']' returned non-zero exit status 1.
  ----------------------------------------
  ERROR: 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
    ERROR: Command errored out with exit status 1:
     command: 'c:program filespython37python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:UsershpAppDataLocalTemppip-install-yynf7muedlibsetup.py'"'"'; __file__='"'"'C:UsershpAppDataLocalTemppip-install-yynf7muedlibsetup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'rn'"'"', '"'"'n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:UsershpAppDataLocalTemppip-record-qzmuuf53install-record.txt' --single-version-externally-managed --compile
         cwd: C:UsershpAppDataLocalTemppip-install-yynf7muedlib
    Complete output (57 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:UsershpAppDataLocalTemppip-install-yynf7muedlibtoolspython -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:UsershpAppDataLocalTemppip-install-yynf7muedlibbuildlib.win-amd64-3.7 -DPYTHON_EXECUTABLE=c:program filespython37python.exe -DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:UsershpAppDataLocalTemppip-install-yynf7muedlibbuildlib.win-amd64-3.7 -A x64'
    -- Building for: NMake Makefiles
    CMake Error at CMakeLists.txt:3 (project):
      Generator

        NMake Makefiles

      does not support platform specification, but platform

        x64

      was specified.


    CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
    CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
    -- Configuring incomplete, errors occurred!
    See also "C:/Users/hp/AppData/Local/Temp/pip-install-yynf7mue/dlib/build/temp.win-amd64-3.7/Release/CMakeFiles/CMakeOutput.log".
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "C:UsershpAppDataLocalTemppip-install-yynf7muedlibsetup.py", line 261, in <module>
        'Topic :: Software Development',
      File "c:program filespython37libsite-packagessetuptools__init__.py", line 145, in setup
        return distutils.core.setup(**attrs)
      File "c:program filespython37libdistutilscore.py", line 148, in setup
        dist.run_commands()
      File "c:program filespython37libdistutilsdist.py", line 966, in run_commands
        self.run_command(cmd)
      File "c:program filespython37libdistutilsdist.py", line 985, in run_command
        cmd_obj.run()
      File "c:program filespython37libsite-packagessetuptoolscommandinstall.py", line 61, in run
        return orig.install.run(self)
      File "c:program filespython37libdistutilscommandinstall.py", line 545, in run
        self.run_command('build')
      File "c:program filespython37libdistutilscmd.py", line 313, in run_command
        self.distribution.run_command(command)
      File "c:program filespython37libdistutilsdist.py", line 985, in run_command
        cmd_obj.run()
      File "c:program filespython37libdistutilscommandbuild.py", line 135, in run
        self.run_command(cmd_name)
      File "c:program filespython37libdistutilscmd.py", line 313, in run_command
        self.distribution.run_command(command)
      File "c:program filespython37libdistutilsdist.py", line 985, in run_command
        cmd_obj.run()
      File "C:UsershpAppDataLocalTemppip-install-yynf7muedlibsetup.py", line 135, in run
        self.build_extension(ext)
      File "C:UsershpAppDataLocalTemppip-install-yynf7muedlibsetup.py", line 172, in build_extension
        subprocess.check_call(cmake_setup, cwd=build_folder)
      File "c:program filespython37libsubprocess.py", line 347, in check_call
        raise CalledProcessError(retcode, cmd)
    subprocess.CalledProcessError: Command '['cmake', 'C:UsershpAppDataLocalTemppip-install-yynf7muedlibtoolspython', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:UsershpAppDataLocalTemppip-install-yynf7muedlibbuildlib.win-amd64-3.7', '-DPYTHON_EXECUTABLE=c:program filespython37python.exe', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:UsershpAppDataLocalTemppip-install-yynf7muedlibbuildlib.win-amd64-3.7', '-A', 'x64']' returned non-zero exit status 1.
    ----------------------------------------
ERROR: Command errored out with exit status 1: 'c:program filespython37python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:UsershpAppDataLocalTemppip-install-yynf7muedlibsetup.py'"'"'; __file__='"'"'C:UsershpAppDataLocalTemppip-install-yynf7muedlibsetup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'rn'"'"', '"'"'n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:UsershpAppDataLocalTemppip-record-qzmuuf53install-record.txt' --single-version-externally-managed --compile Check the logs for full command output.

CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage

psychologist

2 / 2 / 0

Регистрация: 01.01.2010

Сообщений: 189

1

27.03.2019, 22:46. Показов 9138. Ответов 6

Метки нет (Все метки)


я пытаюсь установить пакет face_recognition

pip install face_recognition

выходит ошибка

Python
1
2
3
4
5
6
7
8
9
10
Command "c:usersСергейappdatalocalprogramspythonpython37python.exe -
u -c "import setuptools, tokenize;__file__='C:\Users\D9F8~1\AppData\Local\T
emp\pip-install-rhn9kcgv\dlib\setup.py';f=getattr(tokenize, 'open', open)(__f
ile__);code=f.read().replace('rn', 'n');f.close();exec(compile(code, __file__
, 'exec'))" install --record C:UsersD9F8~1AppDataLocalTemppip-record-lsr9_
rnpinstall-record.txt --single-version-externally-managed --compile" failed wit
h error code 1 in C:UsersD9F8~1AppDataLocalTemppip-install-rhn9kcgvdlib
You are using pip version 18.1, however version 19.0.3 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' comm
and.

C:Windowssystem32>

уже гуглил в инете
cmake 100 раз уже установлен
новый пип поставлен

не помогло.

__________________
Помощь в написании контрольных, курсовых и дипломных работ, диссертаций здесь



0



114 / 22 / 3

Регистрация: 11.09.2017

Сообщений: 141

Записей в блоге: 4

28.03.2019, 08:51

2

psychologist, как вариант, причина может быть такая (Windows not officially supported, but might work), если конечно Вы читали документацию.



0



2 / 2 / 0

Регистрация: 01.01.2010

Сообщений: 189

28.03.2019, 13:21

 [ТС]

3

tabbols95, да я читал на гитхабе, и что теперь, получается кому как повезет? у кого-то библиотека встанет ,а у кого-то нет? )
А можно ли как поставить нужный мне package face_recognition без dlib.
На Убунту кстати все встало. Но мне Убунту не всегда удобен))



0



1283 / 668 / 365

Регистрация: 07.01.2019

Сообщений: 2,176

28.03.2019, 14:01

4

psychologist, попробуйте установить Visual Studio 2017Community Edition



0



0 / 0 / 3

Регистрация: 23.06.2018

Сообщений: 40

02.08.2020, 10:01

5

pip install —no-dependencies face_recognition



0



1797 / 812 / 111

Регистрация: 29.01.2013

Сообщений: 4,861

02.08.2020, 10:19

6

И очень сильно старайтесь, что бы в путях небыло кириллицы. Ну не любят её авторы большинства приложений, не любят!



0



Garry Galler

Эксперт Python

5403 / 3827 / 1214

Регистрация: 28.10.2013

Сообщений: 9,554

Записей в блоге: 1

02.08.2020, 16:55

7

Цитата
Сообщение от psychologist
Посмотреть сообщение

получается кому как повезет? у кого-то библиотека встанет ,а у кого-то нет?

Селяви :-)
Вот мне повезло: на семерке x64 dlib скомпилировалась без всяких танцев с бубном и следования длинной инструкции по инсталляции. Я просто предварительно установил cmake для винды.

Код

C:UsersGarry>pip install face_recognition
Collecting face_recognition
  Using cached face_recognition-1.3.0-py2.py3-none-any.whl (15 kB)
Requirement already satisfied: face-recognition-models>=0.3.0 in f:installpython38libsite-packages (from face_recognition) (0.3.0)
Requirement already satisfied: Click>=6.0 in f:installpython38libsite-packages (from face_recognition) (7.1.2)
Requirement already satisfied: numpy in f:installpython38libsite-packages (from face_recognition) (1.18.5+mkl)
Requirement already satisfied: Pillow in f:installpython38libsite-packages (from face_recognition) (7.1.2)
Collecting dlib>=19.7
  Using cached dlib-19.20.0.tar.gz (3.2 MB)
Building wheels for collected packages: dlib
  Building wheel for dlib (setup.py) ... done
  Created wheel for dlib: filename=dlib-19.20.0-cp38-cp38-win_amd64.whl size=3640523 sha256=67c2842a6e52a45a077d0c6648ac8000fad07d1accb0
  Stored in directory: c:usersgarryappdatalocalpipcachewheelsa5822c2d2ccc604e2c2e35994b89a173d922331f1c6e1af9320a7602
Successfully built dlib
Installing collected packages: dlib, face-recognition
Successfully installed dlib-19.20.0 face-recognition-1.3.0

Python
1
2
3
4
5
6
>>> import face_recognition
>>> image = face_recognition.load_image_file("obama2.jpg")
>>> face_locations = face_recognition.face_locations(image)
>>> face_locations
[(290, 438, 558, 171)]
>>>

Добавлено через 7 минут
Ссылка на установочный Python 3.8 whl пакет со скомпилированной версией dlib для win7x64. Возможно, подойдет и для win810.



0



IT_Exp

Эксперт

87844 / 49110 / 22898

Регистрация: 17.06.2006

Сообщений: 92,604

02.08.2020, 16:55

7

C:Userssuraj>pip install dlib
Collecting dlib
  Using cached https://files.pythonhosted.org/packages/35/8d/e4ddf60452e2fb1ce3164f774e68968b3f110f1cb4cd353235d56875799e/dlib-19.16.0.tar.gz
Building wheels for collected packages: dlib
  Running setup.py bdist_wheel for dlib ... error
  Complete output from command c:userssurajappdatalocalprogramspythonpython37python.exe -u -c "import setuptools, tokenize;__file__='C:\Users\suraj\AppData\Local\Temp\pip-install-ytzp5t26\dlib\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('rn', 'n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d C:UserssurajAppDataLocalTemppip-wheel-mu6pctca --python-tag cp37:
  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.7.2 (tags/v3.7.2:9a3ffc0492, Dec 23 2018, 23:09:28) [MSC v.1916 64 bit (AMD64)]
  Invoking CMake setup: 'cmake C:UserssurajAppDataLocalTemppip-install-ytzp5t26dlibtoolspython -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:UserssurajAppDataLocalTemppip-install-ytzp5t26dlibbuildlib.win-amd64-3.7 -DPYTHON_EXECUTABLE=c:userssurajappdatalocalprogramspythonpython37python.exe -DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:UserssurajAppDataLocalTemppip-install-ytzp5t26dlibbuildlib.win-amd64-3.7 -A x64'
  -- Building for: NMake Makefiles
  CMake Error in CMakeLists.txt:
    Generator

      NMake Makefiles

    **does not support platform specification, but platform
      x64**

    was specified.


  **CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
  CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage**
  -- Configuring incomplete, errors occurred!
  See also "C:/Users/suraj/AppData/Local/Temp/pip-install-ytzp5t26/dlib/build/temp.win-amd64-3.7/Release/CMakeFiles/CMakeOutput.log".
  Traceback (most recent call last):
    File "<string>", line 1, in <module>
    File "C:UserssurajAppDataLocalTemppip-install-ytzp5t26dlibsetup.py", line 257, in <module>
      'Topic :: Software Development',
    File "c:userssurajappdatalocalprogramspythonpython37libsite-packagessetuptools__init__.py", line 143, in setup
      return distutils.core.setup(**attrs)
    File "c:userssurajappdatalocalprogramspythonpython37libdistutilscore.py", line 148, in setup
      dist.run_commands()
    File "c:userssurajappdatalocalprogramspythonpython37libdistutilsdist.py", line 966, in run_commands
      self.run_command(cmd)
    File "c:userssurajappdatalocalprogramspythonpython37libdistutilsdist.py", line 985, in run_command
      cmd_obj.run()
    File "c:userssurajappdatalocalprogramspythonpython37libsite-packageswheelbdist_wheel.py", line 188, in run
      self.run_command('build')
    File "c:userssurajappdatalocalprogramspythonpython37libdistutilscmd.py", line 313, in run_command
      self.distribution.run_command(command)
    File "c:userssurajappdatalocalprogramspythonpython37libdistutilsdist.py", line 985, in run_command
      cmd_obj.run()
    File "c:userssurajappdatalocalprogramspythonpython37libdistutilscommandbuild.py", line 135, in run
      self.run_command(cmd_name)
    File "c:userssurajappdatalocalprogramspythonpython37libdistutilscmd.py", line 313, in run_command
      self.distribution.run_command(command)
    File "c:userssurajappdatalocalprogramspythonpython37libdistutilsdist.py", line 985, in run_command
      cmd_obj.run()
    File "C:UserssurajAppDataLocalTemppip-install-ytzp5t26dlibsetup.py", line 133, in run
      self.build_extension(ext)
    File "C:UserssurajAppDataLocalTemppip-install-ytzp5t26dlibsetup.py", line 170, in build_extension
      subprocess.check_call(cmake_setup, cwd=build_folder)
    File "c:userssurajappdatalocalprogramspythonpython37libsubprocess.py", line 347, in check_call
      raise CalledProcessError(retcode, cmd)
  subprocess.CalledProcessError: Command '['cmake', 'C:\Users\suraj\AppData\Local\Temp\pip-install-ytzp5t26\dlib\tools\python', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\Users\suraj\AppData\Local\Temp\pip-install-ytzp5t26\dlib\build\lib.win-amd64-3.7', '-DPYTHON_EXECUTABLE=c:\users\suraj\appdata\local\programs\python\python37\python.exe', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\Users\suraj\AppData\Local\Temp\pip-install-ytzp5t26\dlib\build\lib.win-amd64-3.7', '-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:userssurajappdatalocalprogramspythonpython37python.exe -u -c "import setuptools, tokenize;__file__='C:\Users\suraj\AppData\Local\Temp\pip-install-ytzp5t26\dlib\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('rn', 'n');f.close();exec(compile(code, __file__, 'exec'))" install --record C:UserssurajAppDataLocalTemppip-record-adx5_t4vinstall-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.7.2 (tags/v3.7.2:9a3ffc0492, Dec 23 2018, 23:09:28) [MSC v.1916 64 bit (AMD64)]
    Invoking CMake setup: 'cmake C:UserssurajAppDataLocalTemppip-install-ytzp5t26dlibtoolspython -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:UserssurajAppDataLocalTemppip-install-ytzp5t26dlibbuildlib.win-amd64-3.7 -DPYTHON_EXECUTABLE=c:userssurajappdatalocalprogramspythonpython37python.exe -DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:UserssurajAppDataLocalTemppip-install-ytzp5t26dlibbuildlib.win-amd64-3.7 -A x64'
    -- Building for: NMake Makefiles
    CMake Error in CMakeLists.txt:
      Generator

        NMake Makefiles

      does not support platform specification, but platform

        x64

      was specified.


    CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
    CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
    -- Configuring incomplete, errors occurred!
    See also "C:/Users/suraj/AppData/Local/Temp/pip-install-ytzp5t26/dlib/build/temp.win-amd64-3.7/Release/CMakeFiles/CMakeOutput.log".
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "C:UserssurajAppDataLocalTemppip-install-ytzp5t26dlibsetup.py", line 257, in <module>
        'Topic :: Software Development',
      File "c:userssurajappdatalocalprogramspythonpython37libsite-packagessetuptools__init__.py", line 143, in setup
        return distutils.core.setup(**attrs)
      File "c:userssurajappdatalocalprogramspythonpython37libdistutilscore.py", line 148, in setup
        dist.run_commands()
      File "c:userssurajappdatalocalprogramspythonpython37libdistutilsdist.py", line 966, in run_commands
        self.run_command(cmd)
      File "c:userssurajappdatalocalprogramspythonpython37libdistutilsdist.py", line 985, in run_command
        cmd_obj.run()
      File "c:userssurajappdatalocalprogramspythonpython37libsite-packagessetuptoolscommandinstall.py", line 61, in run
        return orig.install.run(self)
      File "c:userssurajappdatalocalprogramspythonpython37libdistutilscommandinstall.py", line 545, in run
        self.run_command('build')
      File "c:userssurajappdatalocalprogramspythonpython37libdistutilscmd.py", line 313, in run_command
        self.distribution.run_command(command)
      File "c:userssurajappdatalocalprogramspythonpython37libdistutilsdist.py", line 985, in run_command
        cmd_obj.run()
      File "c:userssurajappdatalocalprogramspythonpython37libdistutilscommandbuild.py", line 135, in run
        self.run_command(cmd_name)
      File "c:userssurajappdatalocalprogramspythonpython37libdistutilscmd.py", line 313, in run_command
        self.distribution.run_command(command)
      File "c:userssurajappdatalocalprogramspythonpython37libdistutilsdist.py", line 985, in run_command
        cmd_obj.run()
      File "C:UserssurajAppDataLocalTemppip-install-ytzp5t26dlibsetup.py", line 133, in run
        self.build_extension(ext)
      File "C:UserssurajAppDataLocalTemppip-install-ytzp5t26dlibsetup.py", line 170, in build_extension
        subprocess.check_call(cmake_setup, cwd=build_folder)
      File "c:userssurajappdatalocalprogramspythonpython37libsubprocess.py", line 347, in check_call
        raise CalledProcessError(retcode, cmd)
    subprocess.CalledProcessError: Command '['cmake', 'C:\Users\suraj\AppData\Local\Temp\pip-install-ytzp5t26\dlib\tools\python', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\Users\suraj\AppData\Local\Temp\pip-install-ytzp5t26\dlib\build\lib.win-amd64-3.7', '-DPYTHON_EXECUTABLE=c:\users\suraj\appdata\local\programs\python\python37\python.exe', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\Users\suraj\AppData\Local\Temp\pip-install-ytzp5t26\dlib\build\lib.win-amd64-3.7', '-A', 'x64']' returned non-zero exit status 1.

    ----------------------------------------
Command "c:userssurajappdatalocalprogramspythonpython37python.exe -u -c "import setuptools, tokenize;__file__='C:\Users\suraj\AppData\Local\Temp\pip-install-ytzp5t26\dlib\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('rn', 'n');f.close();exec(compile(code, __file__, 'exec'))" install --record C:UserssurajAppDataLocalTemppip-record-adx5_t4vinstall-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:UserssurajAppDataLocalTemppip-install-ytzp5t26dlib

Это ошибка, которую я получаю при установке dlib с помощью pip в командной строке. У меня уже есть openCV и matplotlib и numpy.

Я хочу установить компоненты dlib и face_recognition, используемые Python, но я действительно хочу сказать XXX. Я сказал много способов в Интернете. Что Anaconda и Cmake Compility Boost. Сущность Сущность

Может быть, моя версия здесь другая. Я использую Win7 64bit Python2.7 Visual Studio2010. Установите его с PIP

pip install dlib
pip install face_recognition

Все ошибки отчета

Running setup.py bdist_wheel for dlib … error

。。。
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

。。。

  — Building for: Visual Studio 10 2010
  — The C compiler identification is MSVC 16.0.30319.1
  — The CXX compiler identification is MSVC 16.0.30319.1
  — Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studi
o 10.0/VC/bin/x86_amd64/cl.exe
  — Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studi
o 10.0/VC/bin/x86_amd64/cl.exe — works
  — Detecting C compiler ABI info
  — Detecting C compiler ABI info — done
  — Detecting C compile features
  — Detecting C compile features — done
  — Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Stu
dio 10.0/VC/bin/x86_amd64/cl.exe
  — Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Stu
dio 10.0/VC/bin/x86_amd64/cl.exe — works
  — Detecting CXX compiler ABI info
  — Detecting CXX compiler ABI info — done
  — Detecting CXX compile features
  — Detecting CXX compile features — done
  — Found PythonInterp: C:/Python27/python.exe (found version «2.7.15»)
  — Found PythonLibs: C:/Python27/libs/Python27.lib
  — pybind11 v2.2.2
  — Using CMake version: 3.12.0
  — Compiling dlib version: 19.15.0
  CMake Error at C:/Users/Administrator/AppData/Local/Temp/pip-install-tkz7hs/dl
ib/dlib/cmake_utils/set_compiler_specific_options.cmake:27 (message):
    C++11 is required to use dlib, but the version of Visual Studio you are
    using is too old and doesn’t support C++11.  You need Visual Studio 2015 or
    newer.

Я Visual Studio 2010 всегда предлагает обновления и инсталляцию 2015. Я не хочу его устанавливать. Это очень хорошо в 2010 году. Кроме того, многие предыдущие проекты осуществляются в 2010 году. Я боюсь, что это нехорошо улучшить до 2015 года. . Методы пользователей сети, что Anaconda, Cmake. Сущность Сущность Короче говоря, десять на коленях на один шаг, и после двух дней пыток он все еще был скомпрометирован. Сущность Сущность

Через полчаса я установил 2015 год, и это было нормально в PIP установить Face_recognition. Я действительно хочу ругать людей. Сущность Сущность

Отметьте здесь: иногда вам все еще нужно уважать неправильные подсказки. Иногда подсказка журнала ошибок может быть не лучшим решением для вас, но это может быть самым быстрым.

PS: обновление Face_recognition и dlib для удаления 2015, хахаха

Понравилась статья? Поделить с друзьями:
  • Building wheel for cryptography pep 517 error
  • Building wheel for cffi setup py finished with status error
  • Build info client auth error
  • Build failed with error failed to solve failed to read dockerfile
  • Build error multiple tools write to the same file