Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problems installing face_recognition #802

Closed
WalkingCaesar09 opened this issue Apr 15, 2019 · 26 comments
Closed

Problems installing face_recognition #802

WalkingCaesar09 opened this issue Apr 15, 2019 · 26 comments

Comments

@WalkingCaesar09
Copy link

WalkingCaesar09 commented Apr 15, 2019

  • face_recognition version: 1.2.3
  • Python version: 3.7.3
  • Operating System: Windows 10.0.17134.706

Description

I am simply trying to install face recognition for a project of mine and keep receiving this error.

What I Did

C:\Windows\system32>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 face-recognition-models>=0.3.0 (from face_recognition)
Requirement already satisfied: Click>=6.0 in e:\new folder (2)\lib\site-packages (from face_recognition) (7.0)
Collecting dlib>=19.7 (from face_recognition)
Using cached https://files.pythonhosted.org/packages/05/57/e8a8caa3c89a27f80bc78da39c423e2553f482a3705adc619176a3a24b36/dlib-19.17.0.tar.gz
Requirement already satisfied: Pillow in e:\new folder (2)\lib\site-packages (from face_recognition) (6.0.0)
Requirement already satisfied: numpy in e:\new folder (2)\lib\site-packages (from face_recognition) (1.16.2)
Building wheels for collected packages: dlib
Building wheel for dlib (setup.py) ... error
Complete output from command "e:\new folder (2)\python.exe" -u -c "import setuptools, tokenize;file='C:\Users\walki\AppData\Local\Temp\pip-install-76vhd65m\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\walki\AppData\Local\Temp\pip-wheel-s06t1j5i --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.3 (v3.7.3:ef4ec6ed12, Mar 25 2019, 22:22:05) [MSC v.1916 64 bit (AMD64)]
Invoking CMake setup: 'cmake C:\Users\walki\AppData\Local\Temp\pip-install-76vhd65m\dlib\tools\python -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\Users\walki\AppData\Local\Temp\pip-install-76vhd65m\dlib\build\lib.win-amd64-3.7 -DPYTHON_EXECUTABLE=e:\new folder (2)\python.exe -DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\Users\walki\AppData\Local\Temp\pip-install-76vhd65m\dlib\build\lib.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/walki/AppData/Local/Temp/pip-install-76vhd65m/dlib/build/temp.win-amd64-3.7/Release/CMakeFiles/CMakeOutput.log".
Traceback (most recent call last):
File "", line 1, in
File "C:\Users\walki\AppData\Local\Temp\pip-install-76vhd65m\dlib\setup.py", line 261, in
'Topic :: Software Development',
File "e:\new folder (2)\lib\site-packages\setuptools_init_.py", line 145, in setup
return distutils.core.setup(**attrs)
File "e:\new folder (2)\lib\distutils\core.py", line 148, in setup
dist.run_commands()
File "e:\new folder (2)\lib\distutils\dist.py", line 966, in run_commands
self.run_command(cmd)
File "e:\new folder (2)\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "e:\new folder (2)\lib\site-packages\wheel\bdist_wheel.py", line 192, in run
self.run_command('build')
File "e:\new folder (2)\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "e:\new folder (2)\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "e:\new folder (2)\lib\distutils\command\build.py", line 135, in run
self.run_command(cmd_name)
File "e:\new folder (2)\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "e:\new folder (2)\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\Users\walki\AppData\Local\Temp\pip-install-76vhd65m\dlib\setup.py", line 135, in run
self.build_extension(ext)
File "C:\Users\walki\AppData\Local\Temp\pip-install-76vhd65m\dlib\setup.py", line 172, in build_extension
subprocess.check_call(cmake_setup, cwd=build_folder)
File "e:\new folder (2)\lib\subprocess.py", line 347, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', 'C:\Users\walki\AppData\Local\Temp\pip-install-76vhd65m\dlib\tools\python', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\Users\walki\AppData\Local\Temp\pip-install-76vhd65m\dlib\build\lib.win-amd64-3.7', '-DPYTHON_EXECUTABLE=e:\new folder (2)\python.exe', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\Users\walki\AppData\Local\Temp\pip-install-76vhd65m\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: face-recognition-models, dlib, face-recognition
Running setup.py install for dlib ... error
Complete output from command "e:\new folder (2)\python.exe" -u -c "import setuptools, tokenize;file='C:\Users\walki\AppData\Local\Temp\pip-install-76vhd65m\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\walki\AppData\Local\Temp\pip-record-6482f4uw\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.7.3 (v3.7.3:ef4ec6ed12, Mar 25 2019, 22:22:05) [MSC v.1916 64 bit (AMD64)]
Invoking CMake setup: 'cmake C:\Users\walki\AppData\Local\Temp\pip-install-76vhd65m\dlib\tools\python -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\Users\walki\AppData\Local\Temp\pip-install-76vhd65m\dlib\build\lib.win-amd64-3.7 -DPYTHON_EXECUTABLE=e:\new folder (2)\python.exe -DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\Users\walki\AppData\Local\Temp\pip-install-76vhd65m\dlib\build\lib.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/walki/AppData/Local/Temp/pip-install-76vhd65m/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\walki\AppData\Local\Temp\pip-install-76vhd65m\dlib\setup.py", line 261, in <module>
    'Topic :: Software Development',
  File "e:\new folder (2)\lib\site-packages\setuptools\__init__.py", line 145, in setup
    return distutils.core.setup(**attrs)
  File "e:\new folder (2)\lib\distutils\core.py", line 148, in setup
    dist.run_commands()
  File "e:\new folder (2)\lib\distutils\dist.py", line 966, in run_commands
    self.run_command(cmd)
  File "e:\new folder (2)\lib\distutils\dist.py", line 985, in run_command
    cmd_obj.run()
  File "e:\new folder (2)\lib\site-packages\setuptools\command\install.py", line 61, in run
    return orig.install.run(self)
  File "e:\new folder (2)\lib\distutils\command\install.py", line 545, in run
    self.run_command('build')
  File "e:\new folder (2)\lib\distutils\cmd.py", line 313, in run_command
    self.distribution.run_command(command)
  File "e:\new folder (2)\lib\distutils\dist.py", line 985, in run_command
    cmd_obj.run()
  File "e:\new folder (2)\lib\distutils\command\build.py", line 135, in run
    self.run_command(cmd_name)
  File "e:\new folder (2)\lib\distutils\cmd.py", line 313, in run_command
    self.distribution.run_command(command)
  File "e:\new folder (2)\lib\distutils\dist.py", line 985, in run_command
    cmd_obj.run()
  File "C:\Users\walki\AppData\Local\Temp\pip-install-76vhd65m\dlib\setup.py", line 135, in run
    self.build_extension(ext)
  File "C:\Users\walki\AppData\Local\Temp\pip-install-76vhd65m\dlib\setup.py", line 172, in build_extension
    subprocess.check_call(cmake_setup, cwd=build_folder)
  File "e:\new folder (2)\lib\subprocess.py", line 347, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', 'C:\\Users\\walki\\AppData\\Local\\Temp\\pip-install-76vhd65m\\dlib\\tools\\python', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\\Users\\walki\\AppData\\Local\\Temp\\pip-install-76vhd65m\\dlib\\build\\lib.win-amd64-3.7', '-DPYTHON_EXECUTABLE=e:\\new folder (2)\\python.exe', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\\Users\\walki\\AppData\\Local\\Temp\\pip-install-76vhd65m\\dlib\\build\\lib.win-amd64-3.7', '-A', 'x64']' returned non-zero exit status 1.

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

Command ""e:\new folder (2)\python.exe" -u -c "import setuptools, tokenize;file='C:\Users\walki\AppData\Local\Temp\pip-install-76vhd65m\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\walki\AppData\Local\Temp\pip-record-6482f4uw\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\walki\AppData\Local\Temp\pip-install-76vhd65m\dlib\

@amshoo
Copy link

amshoo commented Apr 21, 2019

-pip install cmake
-install visual studio
-pip install Boost

  • pip --no-cache-dir install face_recognition
    -python setup.py install

@yinxiongchen
Copy link

I have the same problem. Have you solved your problem? Can you share your solution? Thanks.

@WalkingCaesar09
Copy link
Author

Unfortunately I have not found a solution for this problem yet.

@Raj9417
Copy link

Raj9417 commented Jun 27, 2019

@WalkingCaesar09 @yinxiongchen refer this link , i have attached how i solve it, hope it is helpful to you.
#813 (comment)

for windows10 user

@Rannvijay
Copy link

-pip install cmake
-install visual studio
-pip install Boost

  • pip --no-cache-dir install face_recognition
    -python setup.py install

Post above Command I am still getting Error as below :
"Could not find a version that satisfies the requirement face_recognition-python (from versions: )
No matching distribution found for face_recognition-python"

Can you please help on same
image

@Raj9417
Copy link

Raj9417 commented Oct 18, 2019

@Rannvijay Did you visit the link i mentioned above? Please watch the video in the link , where you have to install all in same python version, which is python 3.6 amd

@Pydare
Copy link

Pydare commented Oct 18, 2019

Unfortunately I have not found a solution for this problem yet.

Have you seen the solution now? I'm having the exact same issue

@vzyang
Copy link

vzyang commented Oct 18, 2019

same issue failed to build wheel for dlib

@rezapci
Copy link

rezapci commented Oct 19, 2019

si have the same issue failed to build wheel for dlib!

@Raj9417
Copy link

Raj9417 commented Oct 20, 2019

@rezapci @vzyang @Pydare Follow this step please. First delete all python, dlib and face recognition.py in ur pc or current laptop before follow the steps.

  1. Download Python 3.6.8 and install, make sure you add it to PATH.

  2. Install numpy,scipy,matplotlib and pandas in your pc/laptop with this command in command prompt:-
    pip install numpy
    pip install scipy
    pip install matplotlib
    pip install pandas

  3. Go to "https://pypi.org/project/wheel/#files" and right click on filename wheel-0.33.6-py2.py3-none-any.whl (21.6 kB) and copy link address. Then go to your pc/laptop, open command prompt and write this command "python -m pip install" after this command space first then paste the link copied. After install successful go to next step.

  4. Then go this link, https://pypi.org/simple/dlib/ and right click on filename "dlib-19.8.1-cp36-cp36m-win_amd64.whl" then copy link address. Then open command prompt and do the same as step 2 which is, write this command "python -m pip install" after this command space first then paste the link copied. then the dlib will be installed successfully.

  5. After that, type python and enter, then type import dlib to check dlib is installed perfectly. the you can proceed to install face recognition.py which suite for python 3.6.

This is how it will be after dlib and face recognition installed.
Untitled2

NOTE: PLEASE UNINSTALL ALL PYTHON BEFORE YOU TRY THIS STEPS , AND ONLY PYHTON 3.6 WILL WORK WITH THIS STEPS.
THANK YOU.

@venkateshvelaga
Copy link

@rezapci @vzyang @Pydare Follow this step please. First delete all python, dlib and face recognition.py in ur pc or current laptop before follow the steps.

  1. Download Python 3.6.8 and install, make sure you add it to PATH.
  2. Install numpy,scipy,matplotlib and pandas in your pc/laptop with this command in command prompt:-
    pip install numpy
    pip install scipy
    pip install matplotlib
    pip install pandas
  3. Go to "https://pypi.org/project/wheel/#files" and right click on filename wheel-0.33.6-py2.py3-none-any.whl (21.6 kB) and copy link address. Then go to your pc/laptop, open command prompt and write this command "python -m pip install" after this command space first then paste the link copied. After install successful go to next step.
  4. Then go this link, https://pypi.org/simple/dlib/ and right click on filename "dlib-19.8.1-cp36-cp36m-win_amd64.whl" then copy link address. Then open command prompt and do the same as step 2 which is, write this command "python -m pip install" after this command space first then paste the link copied. then the dlib will be installed successfully.
  5. After that, type python and enter, then type import dlib to check dlib is installed perfectly. the you can proceed to install face recognition.py which suite for python 3.6.

This is how it will be after dlib and face recognition installed.
Untitled2

NOTE: PLEASE UNINSTALL ALL PYTHON BEFORE YOU TRY THIS STEPS , AND ONLY PYHTON 3.6 WILL WORK WITH THIS STEPS.
THANK YOU.

Worked like a charm. thanks!

@vamsitharun
Copy link

-pip install cmake
-install visual studio
-pip install Boost

  • pip --no-cache-dir install face_recognition
    -python setup.py install

Thank you, This is working for me.

@imqureshi
Copy link

I was also stuck at this problem and for me the following solution worked:

  1. Install Cmake from the following link.

  2. Install the C++ latest build tools from the visual studio website build tools

  3. Add cmake bin folder and build tools to the path, the default paths of the both are following:
    C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools
    C:\Program Files\CMake\bin
    if you have installed it in a different location add those paths

4 . Now run the command in cmd
pip install face_recognition

This should work in most cases

@Daniyalasif129
Copy link

@rezapci @vzyang @Pydare Follow this step please. First delete all python, dlib and face recognition.py in ur pc or current laptop before follow the steps.

  1. Download Python 3.6.8 and install, make sure you add it to PATH.
  2. Install numpy,scipy,matplotlib and pandas in your pc/laptop with this command in command prompt:-
    pip install numpy
    pip install scipy
    pip install matplotlib
    pip install pandas
  3. Go to "https://pypi.org/project/wheel/#files" and right click on filename wheel-0.33.6-py2.py3-none-any.whl (21.6 kB) and copy link address. Then go to your pc/laptop, open command prompt and write this command "python -m pip install" after this command space first then paste the link copied. After install successful go to next step.
  4. Then go this link, https://pypi.org/simple/dlib/ and right click on filename "dlib-19.8.1-cp36-cp36m-win_amd64.whl" then copy link address. Then open command prompt and do the same as step 2 which is, write this command "python -m pip install" after this command space first then paste the link copied. then the dlib will be installed successfully.
  5. After that, type python and enter, then type import dlib to check dlib is installed perfectly. the you can proceed to install face recognition.py which suite for python 3.6.

This is how it will be after dlib and face recognition installed.
Untitled2
NOTE: PLEASE UNINSTALL ALL PYTHON BEFORE YOU TRY THIS STEPS , AND ONLY PYHTON 3.6 WILL WORK WITH THIS STEPS.
THANK YOU.

Worked like a charm. thanks!

thanks man its working in idle let me hope it works in PYcharm

@Daniyalasif129
Copy link

@rezapci @vzyang @Pydare Follow this step please. First delete all python, dlib and face recognition.py in ur pc or current laptop before follow the steps.

  1. Download Python 3.6.8 and install, make sure you add it to PATH.
  2. Install numpy,scipy,matplotlib and pandas in your pc/laptop with this command in command prompt:-
    pip install numpy
    pip install scipy
    pip install matplotlib
    pip install pandas
  3. Go to "https://pypi.org/project/wheel/#files" and right click on filename wheel-0.33.6-py2.py3-none-any.whl (21.6 kB) and copy link address. Then go to your pc/laptop, open command prompt and write this command "python -m pip install" after this command space first then paste the link copied. After install successful go to next step.
  4. Then go this link, https://pypi.org/simple/dlib/ and right click on filename "dlib-19.8.1-cp36-cp36m-win_amd64.whl" then copy link address. Then open command prompt and do the same as step 2 which is, write this command "python -m pip install" after this command space first then paste the link copied. then the dlib will be installed successfully.
  5. After that, type python and enter, then type import dlib to check dlib is installed perfectly. the you can proceed to install face recognition.py which suite for python 3.6.

This is how it will be after dlib and face recognition installed.
Untitled2

Every thing works very well
Thanks man....
for pycharm user
you must see the DLIB version you are using from your
C:\Users\modi asad\AppData\Local\Programs\Python\Python36\Lib\site-packages
when installing dlib directory in pycharm
after dlib you can install face recognition.....

@Pydare
Copy link

Pydare commented Jan 8, 2020

Thanks a lot @Raj9417 @imqureshi. I have switched to ubuntu 18.04 and everything works way easier for me.

@Daliseiy
Copy link

@Rai220 your solution worked quite well . I was also able to install dlib in a virtual environment. Thanks a lot.

@ghost
Copy link

ghost commented Jan 11, 2020

@rezapci @vzyang @Pydare Follow this step please. First delete all python, dlib and face recognition.py in ur pc or current laptop before follow the steps.

  1. Download Python 3.6.8 and install, make sure you add it to PATH.
  2. Install numpy,scipy,matplotlib and pandas in your pc/laptop with this command in command prompt:-
    pip install numpy
    pip install scipy
    pip install matplotlib
    pip install pandas
  3. Go to "https://pypi.org/project/wheel/#files" and right click on filename wheel-0.33.6-py2.py3-none-any.whl (21.6 kB) and copy link address. Then go to your pc/laptop, open command prompt and write this command "python -m pip install" after this command space first then paste the link copied. After install successful go to next step.
  4. Then go this link, https://pypi.org/simple/dlib/ and right click on filename "dlib-19.8.1-cp36-cp36m-win_amd64.whl" then copy link address. Then open command prompt and do the same as step 2 which is, write this command "python -m pip install" after this command space first then paste the link copied. then the dlib will be installed successfully.
  5. After that, type python and enter, then type import dlib to check dlib is installed perfectly. the you can proceed to install face recognition.py which suite for python 3.6.

This is how it will be after dlib and face recognition installed.
Untitled2

NOTE: PLEASE UNINSTALL ALL PYTHON BEFORE YOU TRY THIS STEPS , AND ONLY PYHTON 3.6 WILL WORK WITH THIS STEPS.
THANK YOU.

Finally it works, I've been searching for an answer for weeks, thank you!

@snehitvaddi
Copy link

snehitvaddi commented Jan 16, 2020

@rezapci @vzyang @Pydare Follow this step please. First delete all python, dlib and face recognition.py in ur pc or current laptop before follow the steps.

  1. Download Python 3.6.8 and install, make sure you add it to PATH.
  2. Install numpy,scipy,matplotlib and pandas in your pc/laptop with this command in command prompt:-
    pip install numpy
    pip install scipy
    pip install matplotlib
    pip install pandas
  3. Go to "https://pypi.org/project/wheel/#files" and right click on filename wheel-0.33.6-py2.py3-none-any.whl (21.6 kB) and copy link address. Then go to your pc/laptop, open command prompt and write this command "python -m pip install" after this command space first then paste the link copied. After install successful go to next step.
  4. Then go this link, https://pypi.org/simple/dlib/ and right click on filename "dlib-19.8.1-cp36-cp36m-win_amd64.whl" then copy link address. Then open command prompt and do the same as step 2 which is, write this command "python -m pip install" after this command space first then paste the link copied. then the dlib will be installed successfully.
  5. After that, type python and enter, then type import dlib to check dlib is installed perfectly. the you can proceed to install face recognition.py which suite for python 3.6.

This is how it will be after dlib and face recognition installed.
Untitled2

NOTE: PLEASE UNINSTALL ALL PYTHON BEFORE YOU TRY THIS STEPS , AND ONLY PYHTON 3.6

This worked fine without any mind boggling with C++ and Visual Studio Installation.
Note : After installing Python 3.6 version along with standard version, to use python 3.6 use
py -3.6 -m pip install dlib

@Siddhi99
Copy link

@rezapci @vzyang @Pydare Follow this step please. First delete all python, dlib and face recognition.py in ur pc or current laptop before follow the steps.

  1. Download Python 3.6.8 and install, make sure you add it to PATH.
  2. Install numpy,scipy,matplotlib and pandas in your pc/laptop with this command in command prompt:-
    pip install numpy
    pip install scipy
    pip install matplotlib
    pip install pandas
  3. Go to "https://pypi.org/project/wheel/#files" and right click on filename wheel-0.33.6-py2.py3-none-any.whl (21.6 kB) and copy link address. Then go to your pc/laptop, open command prompt and write this command "python -m pip install" after this command space first then paste the link copied. After install successful go to next step.
  4. Then go this link, https://pypi.org/simple/dlib/ and right click on filename "dlib-19.8.1-cp36-cp36m-win_amd64.whl" then copy link address. Then open command prompt and do the same as step 2 which is, write this command "python -m pip install" after this command space first then paste the link copied. then the dlib will be installed successfully.
  5. After that, type python and enter, then type import dlib to check dlib is installed perfectly. the you can proceed to install face recognition.py which suite for python 3.6.

This is how it will be after dlib and face recognition installed.
Untitled2

NOTE: PLEASE UNINSTALL ALL PYTHON BEFORE YOU TRY THIS STEPS , AND ONLY PYHTON 3.6 WILL WORK WITH THIS STEPS.
THANK YOU.
IT WORKED! Thanks !

@PhaniDivvela
Copy link

  • face_recognition version: 1.2.3
  • Python version: 3.7.3
  • Operating System: Windows 10.0.17134.706

Description

I am simply trying to install face recognition for a project of mine and keep receiving this error.

What I Did

C:\Windows\system32>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 face-recognition-models>=0.3.0 (from face_recognition)
Requirement already satisfied: Click>=6.0 in e:\new folder (2)\lib\site-packages (from face_recognition) (7.0)
Collecting dlib>=19.7 (from face_recognition)
Using cached https://files.pythonhosted.org/packages/05/57/e8a8caa3c89a27f80bc78da39c423e2553f482a3705adc619176a3a24b36/dlib-19.17.0.tar.gz
Requirement already satisfied: Pillow in e:\new folder (2)\lib\site-packages (from face_recognition) (6.0.0)
Requirement already satisfied: numpy in e:\new folder (2)\lib\site-packages (from face_recognition) (1.16.2)
Building wheels for collected packages: dlib
Building wheel for dlib (setup.py) ... error
Complete output from command "e:\new folder (2)\python.exe" -u -c "import setuptools, tokenize;file='C:\Users\walki\AppData\Local\Temp\pip-install-76vhd65m\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\walki\AppData\Local\Temp\pip-wheel-s06t1j5i --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.3 (v3.7.3:ef4ec6ed12, Mar 25 2019, 22:22:05) [MSC v.1916 64 bit (AMD64)]
Invoking CMake setup: 'cmake C:\Users\walki\AppData\Local\Temp\pip-install-76vhd65m\dlib\tools\python -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\Users\walki\AppData\Local\Temp\pip-install-76vhd65m\dlib\build\lib.win-amd64-3.7 -DPYTHON_EXECUTABLE=e:\new folder (2)\python.exe -DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\Users\walki\AppData\Local\Temp\pip-install-76vhd65m\dlib\build\lib.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/walki/AppData/Local/Temp/pip-install-76vhd65m/dlib/build/temp.win-amd64-3.7/Release/CMakeFiles/CMakeOutput.log".
Traceback (most recent call last):
File "", line 1, in
File "C:\Users\walki\AppData\Local\Temp\pip-install-76vhd65m\dlib\setup.py", line 261, in
'Topic :: Software Development',
File "e:\new folder (2)\lib\site-packages\setuptools__init__.py", line 145, in setup
return distutils.core.setup(**attrs)
File "e:\new folder (2)\lib\distutils\core.py", line 148, in setup
dist.run_commands()
File "e:\new folder (2)\lib\distutils\dist.py", line 966, in run_commands
self.run_command(cmd)
File "e:\new folder (2)\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "e:\new folder (2)\lib\site-packages\wheel\bdist_wheel.py", line 192, in run
self.run_command('build')
File "e:\new folder (2)\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "e:\new folder (2)\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "e:\new folder (2)\lib\distutils\command\build.py", line 135, in run
self.run_command(cmd_name)
File "e:\new folder (2)\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "e:\new folder (2)\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\Users\walki\AppData\Local\Temp\pip-install-76vhd65m\dlib\setup.py", line 135, in run
self.build_extension(ext)
File "C:\Users\walki\AppData\Local\Temp\pip-install-76vhd65m\dlib\setup.py", line 172, in build_extension
subprocess.check_call(cmake_setup, cwd=build_folder)
File "e:\new folder (2)\lib\subprocess.py", line 347, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', 'C:\Users\walki\AppData\Local\Temp\pip-install-76vhd65m\dlib\tools\python', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\Users\walki\AppData\Local\Temp\pip-install-76vhd65m\dlib\build\lib.win-amd64-3.7', '-DPYTHON_EXECUTABLE=e:\new folder (2)\python.exe', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\Users\walki\AppData\Local\Temp\pip-install-76vhd65m\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: face-recognition-models, dlib, face-recognition
Running setup.py install for dlib ... error
Complete output from command "e:\new folder (2)\python.exe" -u -c "import setuptools, tokenize;file='C:\Users\walki\AppData\Local\Temp\pip-install-76vhd65m\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\walki\AppData\Local\Temp\pip-record-6482f4uw\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.7.3 (v3.7.3:ef4ec6ed12, Mar 25 2019, 22:22:05) [MSC v.1916 64 bit (AMD64)]
Invoking CMake setup: 'cmake C:\Users\walki\AppData\Local\Temp\pip-install-76vhd65m\dlib\tools\python -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\Users\walki\AppData\Local\Temp\pip-install-76vhd65m\dlib\build\lib.win-amd64-3.7 -DPYTHON_EXECUTABLE=e:\new folder (2)\python.exe -DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\Users\walki\AppData\Local\Temp\pip-install-76vhd65m\dlib\build\lib.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/walki/AppData/Local/Temp/pip-install-76vhd65m/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\walki\AppData\Local\Temp\pip-install-76vhd65m\dlib\setup.py", line 261, in <module>
    'Topic :: Software Development',
  File "e:\new folder (2)\lib\site-packages\setuptools\__init__.py", line 145, in setup
    return distutils.core.setup(**attrs)
  File "e:\new folder (2)\lib\distutils\core.py", line 148, in setup
    dist.run_commands()
  File "e:\new folder (2)\lib\distutils\dist.py", line 966, in run_commands
    self.run_command(cmd)
  File "e:\new folder (2)\lib\distutils\dist.py", line 985, in run_command
    cmd_obj.run()
  File "e:\new folder (2)\lib\site-packages\setuptools\command\install.py", line 61, in run
    return orig.install.run(self)
  File "e:\new folder (2)\lib\distutils\command\install.py", line 545, in run
    self.run_command('build')
  File "e:\new folder (2)\lib\distutils\cmd.py", line 313, in run_command
    self.distribution.run_command(command)
  File "e:\new folder (2)\lib\distutils\dist.py", line 985, in run_command
    cmd_obj.run()
  File "e:\new folder (2)\lib\distutils\command\build.py", line 135, in run
    self.run_command(cmd_name)
  File "e:\new folder (2)\lib\distutils\cmd.py", line 313, in run_command
    self.distribution.run_command(command)
  File "e:\new folder (2)\lib\distutils\dist.py", line 985, in run_command
    cmd_obj.run()
  File "C:\Users\walki\AppData\Local\Temp\pip-install-76vhd65m\dlib\setup.py", line 135, in run
    self.build_extension(ext)
  File "C:\Users\walki\AppData\Local\Temp\pip-install-76vhd65m\dlib\setup.py", line 172, in build_extension
    subprocess.check_call(cmake_setup, cwd=build_folder)
  File "e:\new folder (2)\lib\subprocess.py", line 347, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', 'C:\\Users\\walki\\AppData\\Local\\Temp\\pip-install-76vhd65m\\dlib\\tools\\python', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\\Users\\walki\\AppData\\Local\\Temp\\pip-install-76vhd65m\\dlib\\build\\lib.win-amd64-3.7', '-DPYTHON_EXECUTABLE=e:\\new folder (2)\\python.exe', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\\Users\\walki\\AppData\\Local\\Temp\\pip-install-76vhd65m\\dlib\\build\\lib.win-amd64-3.7', '-A', 'x64']' returned non-zero exit status 1.

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

Command ""e:\new folder (2)\python.exe" -u -c "import setuptools, tokenize;file='C:\Users\walki\AppData\Local\Temp\pip-install-76vhd65m\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\walki\AppData\Local\Temp\pip-record-6482f4uw\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\walki\AppData\Local\Temp\pip-install-76vhd65m\dlib\

Bro,finally how u solved the problem...........I too got the same problem....Please help me?

@shivani-2001
Copy link

  • face_recognition version: 1.2.3
  • Python version: 3.7.3
  • Operating System: Windows 10.0.17134.706

Description

I am simply trying to install face recognition for a project of mine and keep receiving this error.

What I Did

C:\Windows\system32>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 face-recognition-models>=0.3.0 (from face_recognition)
Requirement already satisfied: Click>=6.0 in e:\new folder (2)\lib\site-packages (from face_recognition) (7.0)
Collecting dlib>=19.7 (from face_recognition)
Using cached https://files.pythonhosted.org/packages/05/57/e8a8caa3c89a27f80bc78da39c423e2553f482a3705adc619176a3a24b36/dlib-19.17.0.tar.gz
Requirement already satisfied: Pillow in e:\new folder (2)\lib\site-packages (from face_recognition) (6.0.0)
Requirement already satisfied: numpy in e:\new folder (2)\lib\site-packages (from face_recognition) (1.16.2)
Building wheels for collected packages: dlib
Building wheel for dlib (setup.py) ... error
Complete output from command "e:\new folder (2)\python.exe" -u -c "import setuptools, tokenize;file='C:\Users\walki\AppData\Local\Temp\pip-install-76vhd65m\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\walki\AppData\Local\Temp\pip-wheel-s06t1j5i --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.3 (v3.7.3:ef4ec6ed12, Mar 25 2019, 22:22:05) [MSC v.1916 64 bit (AMD64)]
Invoking CMake setup: 'cmake C:\Users\walki\AppData\Local\Temp\pip-install-76vhd65m\dlib\tools\python -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\Users\walki\AppData\Local\Temp\pip-install-76vhd65m\dlib\build\lib.win-amd64-3.7 -DPYTHON_EXECUTABLE=e:\new folder (2)\python.exe -DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\Users\walki\AppData\Local\Temp\pip-install-76vhd65m\dlib\build\lib.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/walki/AppData/Local/Temp/pip-install-76vhd65m/dlib/build/temp.win-amd64-3.7/Release/CMakeFiles/CMakeOutput.log".
Traceback (most recent call last):
File "", line 1, in
File "C:\Users\walki\AppData\Local\Temp\pip-install-76vhd65m\dlib\setup.py", line 261, in
'Topic :: Software Development',
File "e:\new folder (2)\lib\site-packages\setuptools__init__.py", line 145, in setup
return distutils.core.setup(**attrs)
File "e:\new folder (2)\lib\distutils\core.py", line 148, in setup
dist.run_commands()
File "e:\new folder (2)\lib\distutils\dist.py", line 966, in run_commands
self.run_command(cmd)
File "e:\new folder (2)\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "e:\new folder (2)\lib\site-packages\wheel\bdist_wheel.py", line 192, in run
self.run_command('build')
File "e:\new folder (2)\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "e:\new folder (2)\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "e:\new folder (2)\lib\distutils\command\build.py", line 135, in run
self.run_command(cmd_name)
File "e:\new folder (2)\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "e:\new folder (2)\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\Users\walki\AppData\Local\Temp\pip-install-76vhd65m\dlib\setup.py", line 135, in run
self.build_extension(ext)
File "C:\Users\walki\AppData\Local\Temp\pip-install-76vhd65m\dlib\setup.py", line 172, in build_extension
subprocess.check_call(cmake_setup, cwd=build_folder)
File "e:\new folder (2)\lib\subprocess.py", line 347, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', 'C:\Users\walki\AppData\Local\Temp\pip-install-76vhd65m\dlib\tools\python', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\Users\walki\AppData\Local\Temp\pip-install-76vhd65m\dlib\build\lib.win-amd64-3.7', '-DPYTHON_EXECUTABLE=e:\new folder (2)\python.exe', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\Users\walki\AppData\Local\Temp\pip-install-76vhd65m\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: face-recognition-models, dlib, face-recognition
Running setup.py install for dlib ... error
Complete output from command "e:\new folder (2)\python.exe" -u -c "import setuptools, tokenize;file='C:\Users\walki\AppData\Local\Temp\pip-install-76vhd65m\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\walki\AppData\Local\Temp\pip-record-6482f4uw\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.7.3 (v3.7.3:ef4ec6ed12, Mar 25 2019, 22:22:05) [MSC v.1916 64 bit (AMD64)]
Invoking CMake setup: 'cmake C:\Users\walki\AppData\Local\Temp\pip-install-76vhd65m\dlib\tools\python -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\Users\walki\AppData\Local\Temp\pip-install-76vhd65m\dlib\build\lib.win-amd64-3.7 -DPYTHON_EXECUTABLE=e:\new folder (2)\python.exe -DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\Users\walki\AppData\Local\Temp\pip-install-76vhd65m\dlib\build\lib.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/walki/AppData/Local/Temp/pip-install-76vhd65m/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\walki\AppData\Local\Temp\pip-install-76vhd65m\dlib\setup.py", line 261, in <module>
    'Topic :: Software Development',
  File "e:\new folder (2)\lib\site-packages\setuptools\__init__.py", line 145, in setup
    return distutils.core.setup(**attrs)
  File "e:\new folder (2)\lib\distutils\core.py", line 148, in setup
    dist.run_commands()
  File "e:\new folder (2)\lib\distutils\dist.py", line 966, in run_commands
    self.run_command(cmd)
  File "e:\new folder (2)\lib\distutils\dist.py", line 985, in run_command
    cmd_obj.run()
  File "e:\new folder (2)\lib\site-packages\setuptools\command\install.py", line 61, in run
    return orig.install.run(self)
  File "e:\new folder (2)\lib\distutils\command\install.py", line 545, in run
    self.run_command('build')
  File "e:\new folder (2)\lib\distutils\cmd.py", line 313, in run_command
    self.distribution.run_command(command)
  File "e:\new folder (2)\lib\distutils\dist.py", line 985, in run_command
    cmd_obj.run()
  File "e:\new folder (2)\lib\distutils\command\build.py", line 135, in run
    self.run_command(cmd_name)
  File "e:\new folder (2)\lib\distutils\cmd.py", line 313, in run_command
    self.distribution.run_command(command)
  File "e:\new folder (2)\lib\distutils\dist.py", line 985, in run_command
    cmd_obj.run()
  File "C:\Users\walki\AppData\Local\Temp\pip-install-76vhd65m\dlib\setup.py", line 135, in run
    self.build_extension(ext)
  File "C:\Users\walki\AppData\Local\Temp\pip-install-76vhd65m\dlib\setup.py", line 172, in build_extension
    subprocess.check_call(cmake_setup, cwd=build_folder)
  File "e:\new folder (2)\lib\subprocess.py", line 347, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', 'C:\\Users\\walki\\AppData\\Local\\Temp\\pip-install-76vhd65m\\dlib\\tools\\python', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\\Users\\walki\\AppData\\Local\\Temp\\pip-install-76vhd65m\\dlib\\build\\lib.win-amd64-3.7', '-DPYTHON_EXECUTABLE=e:\\new folder (2)\\python.exe', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\\Users\\walki\\AppData\\Local\\Temp\\pip-install-76vhd65m\\dlib\\build\\lib.win-amd64-3.7', '-A', 'x64']' returned non-zero exit status 1.

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

Command ""e:\new folder (2)\python.exe" -u -c "import setuptools, tokenize;file='C:\Users\walki\AppData\Local\Temp\pip-install-76vhd65m\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\walki\AppData\Local\Temp\pip-record-6482f4uw\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\walki\AppData\Local\Temp\pip-install-76vhd65m\dlib\

Bro,finally how u solved the problem...........I too got the same problem....Please help me?

Hey, did you find the solution.

@FORTFANOP
Copy link

@rezapci @vzyang @Pydare Follow this step please. First delete all python, dlib and face recognition.py in ur pc or current laptop before follow the steps.

  1. Download Python 3.6.8 and install, make sure you add it to PATH.
  2. Install numpy,scipy,matplotlib and pandas in your pc/laptop with this command in command prompt:-
    pip install numpy
    pip install scipy
    pip install matplotlib
    pip install pandas
  3. Go to "https://pypi.org/project/wheel/#files" and right click on filename wheel-0.33.6-py2.py3-none-any.whl (21.6 kB) and copy link address. Then go to your pc/laptop, open command prompt and write this command "python -m pip install" after this command space first then paste the link copied. After install successful go to next step.
  4. Then go this link, https://pypi.org/simple/dlib/ and right click on filename "dlib-19.8.1-cp36-cp36m-win_amd64.whl" then copy link address. Then open command prompt and do the same as step 2 which is, write this command "python -m pip install" after this command space first then paste the link copied. then the dlib will be installed successfully.
  5. After that, type python and enter, then type import dlib to check dlib is installed perfectly. the you can proceed to install face recognition.py which suite for python 3.6.

This is how it will be after dlib and face recognition installed.
Untitled2

NOTE: PLEASE UNINSTALL ALL PYTHON BEFORE YOU TRY THIS STEPS , AND ONLY PYHTON 3.6 WILL WORK WITH THIS STEPS.
THANK YOU.

Could someone please give a method for Python 3.8? Thanks

@AeroVikas
Copy link

This worked for me on windows 10 pro

FROM python:3.6.8
RUN mkdir -p /app
WORKDIR /app

Copy application requirements file

COPY requirements.txt /app

#Install wheel
RUN python -m pip install https://files.pythonhosted.org/packages/a7/00/3df031b3ecd5444d572141321537080b40c1c25e1caa3d86cdd12e5e919c/wheel-0.35.1-py2.py3-none-any.whl
#install basic libraries
RUN pip install --upgrade pip cmake make cython boost numpy scipy opencv-python opencv-contrib-python matplotlib pandas pillow

#Install dlib
RUN python -m pip install https://files.pythonhosted.org/packages/0e/ce/f8a3cff33ac03a8219768f0694c5d703c8e037e6aba2e865f9bae22ed63c/dlib-19.8.1-cp36-cp36m-win_amd64.whl#sha256=794994fa2c54e7776659fddb148363a5556468a6d5d46be8dad311722d54bfcf

#Install face_recognition
RUN pip install face_recognition

#Install application requirements
RUN pip install -r requirements.txt

CMD ["python","app.py"]

@andrianamin
Copy link

can you say s.th that it can help!!!!!!!!????
sorry but you just show fixed img and it's not useful,
python 3.6.8 / 3.7.9
windows 10

ERROR: Command errored out with exit status 1:
command: 'c:\users\lenovo\appdata\local\programs\python\python37\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\LENOVO\AppData\Local\Temp\pip-install-obmo8_mo\dlib_2e1630899d11474ab6caab0e9f8c785b\setup.py'"'"'; file='"'"'C:\Users\LENOVO\AppData\Local\Temp\pip-install-obmo8_mo\dlib_2e1630899d11474ab6caab0e9f8c785b\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\LENOVO\AppData\Local\Temp\pip-record-f67u8ldl\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\users\lenovo\appdata\local\programs\python\python37\Include\dlib'
cwd: C:\Users\LENOVO\AppData\Local\Temp\pip-install-obmo8_mo\dlib_2e1630899d11474ab6caab0e9f8c785b
Complete output (60 lines):
running install
running build
running build_py
package init file 'tools\python\dlib_init_.py' not found (or not a regular file)
running build_ext
Building extension for Python 3.7.9 (tags/v3.7.9:13c94747c7, Aug 17 2020, 18:58:18) [MSC v.1900 64 bit (AMD64)]
Invoking CMake setup: 'cmake C:\Users\LENOVO\AppData\Local\Temp\pip-install-obmo8_mo\dlib_2e1630899d11474ab6caab0e9f8c785b\tools\python -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\Users\LENOVO\AppData\Local\Temp\pip-install-obmo8_mo\dlib_2e1630899d11474ab6caab0e9f8c785b\build\lib.win-amd64-3.7 -DPYTHON_EXECUTABLE=c:\users\lenovo\appdata\local\programs\python\python37\python.exe -DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\Users\LENOVO\AppData\Local\Temp\pip-install-obmo8_mo\dlib_2e1630899d11474ab6caab0e9f8c785b\build\lib.win-amd64-3.7 -A x64'
-- Building for: NMake Makefiles
CMake Error at CMakeLists.txt:5 (message):

  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!


  You must use Visual Studio to build a python extension on windows.  If you
  are getting this error it means you have not installed Visual C++.  Note
  that there are many flavors of Visual Studio, like Visual Studio for C#
  development.  You need to install Visual Studio for C++.


  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!




-- Configuring incomplete, errors occurred!
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "C:\Users\LENOVO\AppData\Local\Temp\pip-install-obmo8_mo\dlib_2e1630899d11474ab6caab0e9f8c785b\setup.py", line 262, in <module>
    'Topic :: Software Development',
  File "c:\users\lenovo\appdata\local\programs\python\python37\lib\site-packages\setuptools\__init__.py", line 144, in setup
    return distutils.core.setup(**attrs)
  File "c:\users\lenovo\appdata\local\programs\python\python37\lib\distutils\core.py", line 148, in setup
    dist.run_commands()
  File "c:\users\lenovo\appdata\local\programs\python\python37\lib\distutils\dist.py", line 966, in run_commands
    self.run_command(cmd)
  File "c:\users\lenovo\appdata\local\programs\python\python37\lib\distutils\dist.py", line 985, in run_command
    cmd_obj.run()
  File "c:\users\lenovo\appdata\local\programs\python\python37\lib\site-packages\setuptools\command\install.py", line 61, in run
    return orig.install.run(self)
  File "c:\users\lenovo\appdata\local\programs\python\python37\lib\distutils\command\install.py", line 545, in run
    self.run_command('build')
  File "c:\users\lenovo\appdata\local\programs\python\python37\lib\distutils\cmd.py", line 313, in run_command
    self.distribution.run_command(command)
  File "c:\users\lenovo\appdata\local\programs\python\python37\lib\distutils\dist.py", line 985, in run_command
    cmd_obj.run()
  File "c:\users\lenovo\appdata\local\programs\python\python37\lib\distutils\command\build.py", line 135, in run
    self.run_command(cmd_name)
  File "c:\users\lenovo\appdata\local\programs\python\python37\lib\distutils\cmd.py", line 313, in run_command
    self.distribution.run_command(command)
  File "c:\users\lenovo\appdata\local\programs\python\python37\lib\distutils\dist.py", line 985, in run_command
    cmd_obj.run()
  File "C:\Users\LENOVO\AppData\Local\Temp\pip-install-obmo8_mo\dlib_2e1630899d11474ab6caab0e9f8c785b\setup.py", line 135, in run
    self.build_extension(ext)
  File "C:\Users\LENOVO\AppData\Local\Temp\pip-install-obmo8_mo\dlib_2e1630899d11474ab6caab0e9f8c785b\setup.py", line 172, in build_extension
    subprocess.check_call(cmake_setup, cwd=build_folder)
  File "c:\users\lenovo\appdata\local\programs\python\python37\lib\subprocess.py", line 363, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', 'C:\\Users\\LENOVO\\AppData\\Local\\Temp\\pip-install-obmo8_mo\\dlib_2e1630899d11474ab6caab0e9f8c785b\\tools\\python', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\\Users\\LENOVO\\AppData\\Local\\Temp\\pip-install-obmo8_mo\\dlib_2e1630899d11474ab6caab0e9f8c785b\\build\\lib.win-amd64-3.7', '-DPYTHON_EXECUTABLE=c:\\users\\lenovo\\appdata\\local\\programs\\python\\python37\\python.exe', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\\Users\\LENOVO\\AppData\\Local\\Temp\\pip-install-obmo8_mo\\dlib_2e1630899d11474ab6caab0e9f8c785b\\build\\lib.win-amd64-3.7', '-A', 'x64']' returned non-zero exit status 1.
----------------------------------------

ERROR: Command errored out with exit status 1: 'c:\users\lenovo\appdata\local\programs\python\python37\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\LENOVO\AppData\Local\Temp\pip-install-obmo8_mo\dlib_2e1630899d11474ab6caab0e9f8c785b\setup.py'"'"'; file='"'"'C:\Users\LENOVO\AppData\Local\Temp\pip-install-obmo8_mo\dlib_2e1630899d11474ab6caab0e9f8c785b\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\LENOVO\AppData\Local\Temp\pip-record-f67u8ldl\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\users\lenovo\appdata\local\programs\python\python37\Include\dlib' Check the logs for full command output.

@sidgubert
Copy link

Solve the same problem in this link:

https://gist.github.com/ageitgey/629d75c1baac34dfa5ca2a1928a7aeaf

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests