How can I solve Error of installation Dlib? - python

How I can install dlib. I tried to install dlib in many way but it's alway error.
Got an error:
ERROR: Complete output from command 'C:\ProgramData\Anaconda3\python.exe' -u -c 'import setuptools, tokenize;__file__='"'"'C:\\Users\\hommy\\AppData\\Local\\Temp\\pip-install-c_rc8wfx\\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\hommy\AppData\Local\Temp\pip-wheel-5e3dfpnu' --python-tag cp37:
ERROR: 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 (default, Apr 24 2019, 15:29:51) [MSC v.1915 64 bit (AMD64)]
Invoking CMake setup: 'cmake C:\Users\hommy\AppData\Local\Temp\pip-install-c_rc8wfx\dlib\tools\python -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\Users\hommy\AppData\Local\Temp\pip-install-c_rc8wfx\dlib\build\lib.win-amd64-3.7 -DPYTHON_EXECUTABLE=C:\ProgramData\Anaconda3\python.exe -DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\Users\hommy\AppData\Local\Temp\pip-install-c_rc8wfx\dlib\build\lib.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/hommy/AppData/Local/Temp/pip-install-c_rc8wfx/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\hommy\AppData\Local\Temp\pip-install-c_rc8wfx\dlib\setup.py", line 261, in <module>
'Topic :: Software Development',
File "C:\ProgramData\Anaconda3\lib\site-packages\setuptools\__init__.py", line 145, in setup
return distutils.core.setup(**attrs)
File "C:\ProgramData\Anaconda3\lib\distutils\core.py", line 148, in setup
dist.run_commands()
File "C:\ProgramData\Anaconda3\lib\distutils\dist.py", line 966, in run_commands
self.run_command(cmd)
File "C:\ProgramData\Anaconda3\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\ProgramData\Anaconda3\lib\site-packages\wheel\bdist_wheel.py", line 192, in run
self.run_command('build')
File "C:\ProgramData\Anaconda3\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "C:\ProgramData\Anaconda3\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\ProgramData\Anaconda3\lib\distutils\command\build.py", line 135, in run
self.run_command(cmd_name)
File "C:\ProgramData\Anaconda3\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "C:\ProgramData\Anaconda3\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\Users\hommy\AppData\Local\Temp\pip-install-c_rc8wfx\dlib\setup.py", line 135, in run
self.build_extension(ext)
File "C:\Users\hommy\AppData\Local\Temp\pip-install-c_rc8wfx\dlib\setup.py", line 172, in build_extension
subprocess.check_call(cmake_setup, cwd=build_folder)
File "C:\ProgramData\Anaconda3\lib\subprocess.py", line 347, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', 'C:\\Users\\hommy\\AppData\\Local\\Temp\\pip-install-c_rc8wfx\\dlib\\tools\\python', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\\Users\\hommy\\AppData\\Local\\Temp\\pip-install-c_rc8wfx\\dlib\\build\\lib.win-amd64-3.7', '-DPYTHON_EXECUTABLE=C:\\ProgramData\\Anaconda3\\python.exe', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\\Users\\hommy\\AppData\\Local\\Temp\\pip-install-c_rc8wfx\\dlib\\build\\lib.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: Complete output from command 'C:\ProgramData\Anaconda3\python.exe' -u -c 'import setuptools, tokenize;__file__='"'"'C:\\Users\\hommy\\AppData\\Local\\Temp\\pip-install-c_rc8wfx\\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\hommy\AppData\Local\Temp\pip-record-ik12xcpk\install-record.txt' --single-version-externally-managed --compile:
ERROR: 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 (default, Apr 24 2019, 15:29:51) [MSC v.1915 64 bit (AMD64)]
Invoking CMake setup: 'cmake C:\Users\hommy\AppData\Local\Temp\pip-install-c_rc8wfx\dlib\tools\python -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\Users\hommy\AppData\Local\Temp\pip-install-c_rc8wfx\dlib\build\lib.win-amd64-3.7 -DPYTHON_EXECUTABLE=C:\ProgramData\Anaconda3\python.exe -DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\Users\hommy\AppData\Local\Temp\pip-install-c_rc8wfx\dlib\build\lib.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/hommy/AppData/Local/Temp/pip-install-c_rc8wfx/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\hommy\AppData\Local\Temp\pip-install-c_rc8wfx\dlib\setup.py", line 261, in <module>
'Topic :: Software Development',
File "C:\ProgramData\Anaconda3\lib\site-packages\setuptools\__init__.py", line 145, in setup
return distutils.core.setup(**attrs)
File "C:\ProgramData\Anaconda3\lib\distutils\core.py", line 148, in setup
dist.run_commands()
File "C:\ProgramData\Anaconda3\lib\distutils\dist.py", line 966, in run_commands
self.run_command(cmd)
File "C:\ProgramData\Anaconda3\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\ProgramData\Anaconda3\lib\site-packages\setuptools\command\install.py", line 61, in run
return orig.install.run(self)
File "C:\ProgramData\Anaconda3\lib\distutils\command\install.py", line 545, in run
self.run_command('build')
File "C:\ProgramData\Anaconda3\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "C:\ProgramData\Anaconda3\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\ProgramData\Anaconda3\lib\distutils\command\build.py", line 135, in run
self.run_command(cmd_name)
File "C:\ProgramData\Anaconda3\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "C:\ProgramData\Anaconda3\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\Users\hommy\AppData\Local\Temp\pip-install-c_rc8wfx\dlib\setup.py", line 135, in run
self.build_extension(ext)
File "C:\Users\hommy\AppData\Local\Temp\pip-install-c_rc8wfx\dlib\setup.py", line 172, in build_extension
subprocess.check_call(cmake_setup, cwd=build_folder)
File "C:\ProgramData\Anaconda3\lib\subprocess.py", line 347, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', 'C:\\Users\\hommy\\AppData\\Local\\Temp\\pip-install-c_rc8wfx\\dlib\\tools\\python', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\\Users\\hommy\\AppData\\Local\\Temp\\pip-install-c_rc8wfx\\dlib\\build\\lib.win-amd64-3.7', '-DPYTHON_EXECUTABLE=C:\\ProgramData\\Anaconda3\\python.exe', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\\Users\\hommy\\AppData\\Local\\Temp\\pip-install-c_rc8wfx\\dlib\\build\\lib.win-amd64-3.7', '-A', 'x64']' returned non-zero exit status 1.
----------------------------------------
ERROR: Command "'C:\ProgramData\Anaconda3\python.exe' -u -c 'import setuptools, tokenize;__file__='"'"'C:\\Users\\hommy\\AppData\\Local\\Temp\\pip-install-c_rc8wfx\\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\hommy\AppData\Local\Temp\pip-record-ik12xcpk\install-record.txt' --single-version-externally-managed --compile" failed with error code 1 in C:\Users\hommy\AppData\Local\Temp\pip-install-c_rc8wfx\dlib\

Anaconda is available from, https://www.anaconda.com/distribution/#download-section
conda instruction are, https://docs.conda.io/projects/conda/en/4.6.0/_downloads/52a95608c49671267e40c689e0bc00ca/conda-cheatsheet.pdf
Dlib is support with python 3.6 to 3.7.0 version s.Try to install the dlib in anaconda prompt by following command.,
step 1:
conda create -n env_name python=3.7.0
step 2:
conda activate env_name
step 3:
conda install -c conda-forge dlib=19.17
-c is stands for channel, conda-forge is one of channels.
you can find all supported packages for conda's in this link https://repo.anaconda.com/pkgs/main/win-64/

Related

dlib not installing pycharm, how to fix? No other posts have helped. I need to use python 3.9

I am not able to install dlib on my computer. It gives me this error, but no other posts have helped me. I have been searching for a few hours now but to no avail. I am not familiar with the pip command, so this error does not tell me any meaningful information. Can someone who is more experienced please tell me why this is not working? I have already tried reinstalling Microsoft Visual Studio C++ 2015, but that did not work. Installing CMake did not work either. Can someone please help me fix this?
Error:
pip install dlib
Collecting dlib
Using cached dlib-19.22.1.tar.gz (7.4 MB)
Building wheels for collected packages: dlib
Building wheel for dlib (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: 'C:\Users\danie\Desktop\pythonProject\venv\Scripts\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\danie\\AppData
\\Local\\Temp\\pip-install-qaxhyxsu\\dlib_74869802ec0f4350b1acbcfa765926a5\\setup.py'"'"'; __file__='"'"'C:\\Users\\danie\\AppData\\Local\\Temp\\pip-install-qaxhyxsu\\d
lib_74869802ec0f4350b1acbcfa765926a5\\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setupto
ols import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d 'C:\Users\
danie\AppData\Local\Temp\pip-wheel-aho58vt2'
cwd: C:\Users\danie\AppData\Local\Temp\pip-install-qaxhyxsu\dlib_74869802ec0f4350b1acbcfa765926a5\
Complete output (58 lines):
running bdist_wheel
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.9.5 (tags/v3.9.5:0a7dcbd, May 3 2021, 17:27:52) [MSC v.1928 64 bit (AMD64)]
Invoking CMake setup: 'cmake C:\Users\danie\AppData\Local\Temp\pip-install-qaxhyxsu\dlib_74869802ec0f4350b1acbcfa765926a5\tools\python -DCMAKE_LIBRARY_OUTPUT_DIRECTOR
Y=C:\Users\danie\AppData\Local\Temp\pip-install-qaxhyxsu\dlib_74869802ec0f4350b1acbcfa765926a5\build\lib.win-amd64-3.9 -DPYTHON_EXECUTABLE=C:\Users\danie\Desktop\python
Project\venv\Scripts\python.exe -DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\Users\danie\AppData\Local\Temp\pip-install-qaxhyxsu\dlib_74869802ec0f4350b1acbcfa765926a5\bu
ild\lib.win-amd64-3.9 -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\danie\AppData\Local\Temp\pip-install-qaxhyxsu\dlib_74869802ec0f4350b1acbcfa765926a5\setup.py", line 222, in <module>
setup(
File "C:\Users\danie\Desktop\pythonProject\venv\lib\site-packages\setuptools\__init__.py", line 153, in setup
return distutils.core.setup(**attrs)
File "C:\Users\danie\AppData\Local\Programs\Python\Python39\lib\distutils\core.py", line 148, in setup
dist.run_commands()
File "C:\Users\danie\AppData\Local\Programs\Python\Python39\lib\distutils\dist.py", line 966, in run_commands
self.run_command(cmd)
File "C:\Users\danie\AppData\Local\Programs\Python\Python39\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\Users\danie\Desktop\pythonProject\venv\lib\site-packages\wheel\bdist_wheel.py", line 299, in run
self.run_command('build')
File "C:\Users\danie\AppData\Local\Programs\Python\Python39\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "C:\Users\danie\AppData\Local\Programs\Python\Python39\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\Users\danie\AppData\Local\Programs\Python\Python39\lib\distutils\command\build.py", line 135, in run
self.run_command(cmd_name)
File "C:\Users\danie\AppData\Local\Programs\Python\Python39\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "C:\Users\danie\AppData\Local\Programs\Python\Python39\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\Users\danie\AppData\Local\Temp\pip-install-qaxhyxsu\dlib_74869802ec0f4350b1acbcfa765926a5\setup.py", line 134, in run
self.build_extension(ext)
File "C:\Users\danie\AppData\Local\Temp\pip-install-qaxhyxsu\dlib_74869802ec0f4350b1acbcfa765926a5\setup.py", line 171, in build_extension
subprocess.check_call(cmake_setup, cwd=build_folder)
File "C:\Users\danie\AppData\Local\Programs\Python\Python39\lib\subprocess.py", line 373, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', 'C:\\Users\\danie\\AppData\\Local\\Temp\\pip-install-qaxhyxsu\\dlib_74869802ec0f4350b1acbcfa765926a5\\tools\\python'
, '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\\Users\\danie\\AppData\\Local\\Temp\\pip-install-qaxhyxsu\\dlib_74869802ec0f4350b1acbcfa765926a5\\build\\lib.win-amd64-3.9', '-DP
YTHON_EXECUTABLE=C:\\Users\\danie\\Desktop\\pythonProject\\venv\\Scripts\\python.exe', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\\Users\\danie\\AppData\\Local\\Temp\
\pip-install-qaxhyxsu\\dlib_74869802ec0f4350b1acbcfa765926a5\\build\\lib.win-amd64-3.9', '-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:\Users\danie\Desktop\pythonProject\venv\Scripts\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\danie\\AppDa
ta\\Local\\Temp\\pip-install-qaxhyxsu\\dlib_74869802ec0f4350b1acbcfa765926a5\\setup.py'"'"'; __file__='"'"'C:\\Users\\danie\\AppData\\Local\\Temp\\pip-install-qaxhyxsu\
\dlib_74869802ec0f4350b1acbcfa765926a5\\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setup
tools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Us
ers\danie\AppData\Local\Temp\pip-record-3n7tervb\install-record.txt' --single-version-externally-managed --compile --install-headers 'C:\Users\danie\Desktop\pythonProje
ct\venv\include\site\python3.9\dlib'
cwd: C:\Users\danie\AppData\Local\Temp\pip-install-qaxhyxsu\dlib_74869802ec0f4350b1acbcfa765926a5\
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.9.5 (tags/v3.9.5:0a7dcbd, May 3 2021, 17:27:52) [MSC v.1928 64 bit (AMD64)]
Invoking CMake setup: 'cmake C:\Users\danie\AppData\Local\Temp\pip-install-qaxhyxsu\dlib_74869802ec0f4350b1acbcfa765926a5\tools\python -DCMAKE_LIBRARY_OUTPUT_DIRECT
ORY=C:\Users\danie\AppData\Local\Temp\pip-install-qaxhyxsu\dlib_74869802ec0f4350b1acbcfa765926a5\build\lib.win-amd64-3.9 -DPYTHON_EXECUTABLE=C:\Users\danie\Desktop\pyth
onProject\venv\Scripts\python.exe -DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\Users\danie\AppData\Local\Temp\pip-install-qaxhyxsu\dlib_74869802ec0f4350b1acbcfa765926a5\
build\lib.win-amd64-3.9 -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\danie\AppData\Local\Temp\pip-install-qaxhyxsu\dlib_74869802ec0f4350b1acbcfa765926a5\setup.py", line 222, in <module>
setup(
File "C:\Users\danie\Desktop\pythonProject\venv\lib\site-packages\setuptools\__init__.py", line 153, in setup
return distutils.core.setup(**attrs)
File "C:\Users\danie\AppData\Local\Programs\Python\Python39\lib\distutils\core.py", line 148, in setup
dist.run_commands()
File "C:\Users\danie\AppData\Local\Programs\Python\Python39\lib\distutils\dist.py", line 966, in run_commands
self.run_command(cmd)
File "C:\Users\danie\AppData\Local\Programs\Python\Python39\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\Users\danie\Desktop\pythonProject\venv\lib\site-packages\setuptools\command\install.py", line 61, in run
return orig.install.run(self)
File "C:\Users\danie\AppData\Local\Programs\Python\Python39\lib\distutils\command\install.py", line 546, in run
self.run_command('build')
File "C:\Users\danie\AppData\Local\Programs\Python\Python39\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "C:\Users\danie\AppData\Local\Programs\Python\Python39\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\Users\danie\AppData\Local\Programs\Python\Python39\lib\distutils\command\build.py", line 135, in run
self.run_command(cmd_name)
File "C:\Users\danie\AppData\Local\Programs\Python\Python39\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "C:\Users\danie\AppData\Local\Programs\Python\Python39\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\Users\danie\AppData\Local\Temp\pip-install-qaxhyxsu\dlib_74869802ec0f4350b1acbcfa765926a5\setup.py", line 134, in run
self.build_extension(ext)
File "C:\Users\danie\AppData\Local\Temp\pip-install-qaxhyxsu\dlib_74869802ec0f4350b1acbcfa765926a5\setup.py", line 171, in build_extension
subprocess.check_call(cmake_setup, cwd=build_folder)
File "C:\Users\danie\AppData\Local\Programs\Python\Python39\lib\subprocess.py", line 373, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', 'C:\\Users\\danie\\AppData\\Local\\Temp\\pip-install-qaxhyxsu\\dlib_74869802ec0f4350b1acbcfa765926a5\\tools\\pytho
n', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\\Users\\danie\\AppData\\Local\\Temp\\pip-install-qaxhyxsu\\dlib_74869802ec0f4350b1acbcfa765926a5\\build\\lib.win-amd64-3.9', '-
DPYTHON_EXECUTABLE=C:\\Users\\danie\\Desktop\\pythonProject\\venv\\Scripts\\python.exe', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\\Users\\danie\\AppData\\Local\\Tem
p\\pip-install-qaxhyxsu\\dlib_74869802ec0f4350b1acbcfa765926a5\\build\\lib.win-amd64-3.9', '-A', 'x64']' returned non-zero exit status 1.
----------------------------------------
ERROR: Command errored out with exit status 1: 'C:\Users\danie\Desktop\pythonProject\venv\Scripts\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[
0] = '"'"'C:\\Users\\danie\\AppData\\Local\\Temp\\pip-install-qaxhyxsu\\dlib_74869802ec0f4350b1acbcfa765926a5\\setup.py'"'"'; __file__='"'"'C:\\Users\\danie\\AppData\\L
ocal\\Temp\\pip-install-qaxhyxsu\\dlib_74869802ec0f4350b1acbcfa765926a5\\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__)
else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exe
c'"'"'))' install --record 'C:\Users\danie\AppData\Local\Temp\pip-record-3n7tervb\install-record.txt' --single-version-externally-managed --compile --install-headers 'C
:\Users\danie\Desktop\pythonProject\venv\include\site\python3.9\dlib' Check the logs for full command output.
WARNING: You are using pip version 21.1.2; however, version 21.3.1 is available.
You should consider upgrading via the 'C:\Users\danie\Desktop\pythonProject\venv\Scripts\python.exe -m pip install --upgrade pip' command.
download cmake executable file on your pc, install it and install cmake build tools for c++ from visual studio build tools. After installing cmake with visual studio build tools, you need to download dlib wheel file from this github repo: https://github.com/Tobyyosoba777/Computer-Vision-OpenCv-Python-/tree/main/Libraries
download: dlib-19.22.99-cp39-cp39-win_amd64.whl
and download: dlib-19.22.99.win-amd64-py3.9.exe
install the .exe file on your pc, restart it(not necessary) and open the current directory of the downloaded .whl file where it is saved on your pc in your python/anaconda terminal/ cmd
for example:
C:\Users\USER->cd desktop "if you downloaded the file to your desktop" this command will move you to the current directory of the .whl file
then input: "pip install dlib-19.22.99-cp39-cp39-win_amd64.whl"
that should work
It worked after I installed all of the visual studio build things (all 80 gb)
Just for anyone coming to this in the future

How to solve CMake must be installed to build the following extensions: dlib in PyCharm?

Facing the following error while installing dlib for the OpenCV project. It shows that
CMake must be installed to build the following extensions: dlib.
Command Output:
Collecting dlib==19.18.0
Using cached dlib-19.18.0.tar.gz (3.1 MB)
Using legacy 'setup.py install' for dlib, since package 'wheel' is not installed.
Installing collected packages: dlib
Running setup.py install for dlib: started
Running setup.py install for dlib: finished with status 'error'
ERROR: Command errored out with exit status 1:
command: 'D:\Install Drive\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\mahmu\\AppData\\Local\\Temp\\pip-install-a4s1a_zh\\dlib\\setup.py'"'"'; __file__='"'"'C:\\Users\\mahmu\\AppData\\Local\\Temp\\pip-install-a4s1a_zh\\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\mahmu\AppData\Local\Temp\pip-record-mjm6k3c3\install-record.txt' --single-version-externally-managed --compile --install-headers 'D:\Install Drive\Include\dlib'
cwd: C:\Users\mahmu\AppData\Local\Temp\pip-install-a4s1a_zh\dlib\
Complete output (57 lines):
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
Traceback (most recent call last):
File "C:\Users\mahmu\AppData\Local\Temp\pip-install-a4s1a_zh\dlib\setup.py", line 120, in get_cmake_version
out = subprocess.check_output(['cmake', '--version'])
File "D:\Install Drive\lib\subprocess.py", line 424, in check_output
return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
File "D:\Install Drive\lib\subprocess.py", line 505, in run
with Popen(*popenargs, **kwargs) as process:
File "D:\Install Drive\lib\subprocess.py", line 951, in __init__
self._execute_child(args, executable, preexec_fn, close_fds,
File "D:\Install Drive\lib\subprocess.py", line 1420, in _execute_child
hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
FileNotFoundError: [WinError 2] The system cannot find the file specified
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\mahmu\AppData\Local\Temp\pip-install-a4s1a_zh\dlib\setup.py", line 223, in <module>
setup(
File "D:\Install Drive\lib\site-packages\setuptools\__init__.py", line 165, in setup
return distutils.core.setup(**attrs)
File "D:\Install Drive\lib\distutils\core.py", line 148, in setup
dist.run_commands()
File "D:\Install Drive\lib\distutils\dist.py", line 966, in run_commands
self.run_command(cmd)
File "D:\Install Drive\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "D:\Install Drive\lib\site-packages\setuptools\command\install.py", line 61, in run
return orig.install.run(self)
File "D:\Install Drive\lib\distutils\command\install.py", line 546, in run
self.run_command('build')
File "D:\Install Drive\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "D:\Install Drive\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "D:\Install Drive\lib\distutils\command\build.py", line 135, in run
self.run_command(cmd_name)
File "D:\Install Drive\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "D:\Install Drive\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\Users\mahmu\AppData\Local\Temp\pip-install-a4s1a_zh\dlib\setup.py", line 129, in run
cmake_version = self.get_cmake_version()
File "C:\Users\mahmu\AppData\Local\Temp\pip-install-a4s1a_zh\dlib\setup.py", line 122, in get_cmake_version
raise RuntimeError("\n*******************************************************************\n" +
RuntimeError:
*******************************************************************
CMake must be installed to build the following extensions: dlib
*******************************************************************
----------------------------------------
ERROR: Command errored out with exit status 1: 'D:\Install Drive\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\mahmu\\AppData\\Local\\Temp\\pip-install-a4s1a_zh\\dlib\\setup.py'"'"'; __file__='"'"'C:\\Users\\mahmu\\AppData\\Local\\Temp\\pip-install-a4s1a_zh\\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\mahmu\AppData\Local\Temp\pip-record-mjm6k3c3\install-record.txt' --single-version-externally-managed --compile --install-headers 'D:\Install Drive\Include\dlib' Check the logs for full command output.
WARNING: You are using pip version 20.2.3; however, version 21.1.2 is available.
You should consider upgrading via the 'D:\Install Drive\python.exe -m pip install --upgrade pip' command.
Notice that in the output that "CMake must be installed to build the following extensions: dlib". So install CMake first and only then try to install dlib. If CMake is installed, try updating your pip version to 21.1.2 via "D:\Install Drive\python.exe -m pip install --upgrade pip".
It requires cmake must be installed before installing dlib. Do execute in the following order.
pip install cmake
pip install dlib
This will fix the issue.

Error in installing python face_recognition

I have installed Python 3.7.8. in my machine. When I tried to install python face_recognition library I got some errors which telling that need to install cmake and visual c++. Then I installed cmake and visual c++ 2015-2019. But I still get the following errors when I try to install.
Please help me to solve this.
C:\Users\prasa>pip3 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 c:\users\prasa\appdata\local\programs\python\python37\lib\site-packages (from face_recognition) (0.3.0)
Requirement already satisfied numpy in c:\users\prasa\appdata\local\programs\python\python37\lib\site-packages (from face_recognition) (1.18.5)
Requirement already satisfied: Pillow in c:\users\prasa\appdata\local\programs\python\python37\lib\site-packages (from face_recognition) (7.2.0)
Requirement already satisfied: Click>=6.0 in c:\users\prasa\appdata\local\programs\python\python37\lib\site-packages (from face_recognition) (7.1.2)
Collecting dlib>=19.7
Using cached dlib-19.21.0.tar.gz (3.2 MB)
Building wheels for collected packages: dlib
Building wheel for dlib (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: 'c:\users\prasa\appdata\local\programs\python\python37\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\prasa\\AppData\\Local\\Temp\\pip-install-08cdgdia\\dlib\\setup.py'"'"'; __file__='"'"'C:\\Users\\prasa\\AppData\\Local\\Temp\\pip-install-08cdgdia\\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\prasa\AppData\Local\Temp\pip-wheel-y5alb_6d'
cwd: C:\Users\prasa\AppData\Local\Temp\pip-install-08cdgdia\dlib\
Complete output (58 lines):
running bdist_wheel
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.8 (tags/v3.7.8:4b47a5b6ba, Jun 28 2020, 08:53:46) [MSC v.1916 64 bit (AMD64)]
Invoking CMake setup: 'cmake C:\Users\prasa\AppData\Local\Temp\pip-install-08cdgdia\dlib\tools\python -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\Users\prasa\AppData\Local\Temp\pip-install-08cdgdia\dlib\build\lib.win-amd64-3.7 -DPYTHON_EXECUTABLE=c:\users\prasa\appdata\local\programs\python\python37\python.exe -DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\Users\prasa\AppData\Local\Temp\pip-install-08cdgdia\dlib\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\prasa\AppData\Local\Temp\pip-install-08cdgdia\dlib\setup.py", line 262, in <module>
'Topic :: Software Development',
File "c:\users\prasa\appdata\local\programs\python\python37\lib\site-packages\setuptools\__init__.py", line 144, in setup
return distutils.core.setup(**attrs)
File "c:\users\prasa\appdata\local\programs\python\python37\lib\distutils\core.py", line 148, in setup
dist.run_commands()
File "c:\users\prasa\appdata\local\programs\python\python37\lib\distutils\dist.py", line 966, in run_commands
self.run_command(cmd)
File "c:\users\prasa\appdata\local\programs\python\python37\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "c:\users\prasa\appdata\local\programs\python\python37\lib\site-packages\wheel\bdist_wheel.py", line 290, in run
self.run_command('build')
File "c:\users\prasa\appdata\local\programs\python\python37\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "c:\users\prasa\appdata\local\programs\python\python37\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "c:\users\prasa\appdata\local\programs\python\python37\lib\distutils\command\build.py", line 135, in run
self.run_command(cmd_name)
File "c:\users\prasa\appdata\local\programs\python\python37\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "c:\users\prasa\appdata\local\programs\python\python37\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\Users\prasa\AppData\Local\Temp\pip-install-08cdgdia\dlib\setup.py", line 135, in run
self.build_extension(ext)
File "C:\Users\prasa\AppData\Local\Temp\pip-install-08cdgdia\dlib\setup.py", line 172, in build_extension
subprocess.check_call(cmake_setup, cwd=build_folder)
File "c:\users\prasa\appdata\local\programs\python\python37\lib\subprocess.py", line 363, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', 'C:\\Users\\prasa\\AppData\\Local\\Temp\\pip-install-08cdgdia\\dlib\\tools\\python', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\\Users\\prasa\\AppData\\Local\\Temp\\pip-install-08cdgdia\\dlib\\build\\lib.win-amd64-3.7', '-DPYTHON_EXECUTABLE=c:\\users\\prasa\\appdata\\local\\programs\\python\\python37\\python.exe', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\\Users\\prasa\\AppData\\Local\\Temp\\pip-install-08cdgdia\\dlib\\build\\lib.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, face-recognition
Running setup.py install for dlib ... error
ERROR: Command errored out with exit status 1:
command: 'c:\users\prasa\appdata\local\programs\python\python37\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\prasa\\AppData\\Local\\Temp\\pip-install-08cdgdia\\dlib\\setup.py'"'"'; __file__='"'"'C:\\Users\\prasa\\AppData\\Local\\Temp\\pip-install-08cdgdia\\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\prasa\AppData\Local\Temp\pip-record-h34wkq_s\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\users\prasa\appdata\local\programs\python\python37\Include\dlib'
cwd: C:\Users\prasa\AppData\Local\Temp\pip-install-08cdgdia\dlib\
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.8 (tags/v3.7.8:4b47a5b6ba, Jun 28 2020, 08:53:46) [MSC v.1916 64 bit (AMD64)]
Invoking CMake setup: 'cmake C:\Users\prasa\AppData\Local\Temp\pip-install-08cdgdia\dlib\tools\python -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\Users\prasa\AppData\Local\Temp\pip-install-08cdgdia\dlib\build\lib.win-amd64-3.7 -DPYTHON_EXECUTABLE=c:\users\prasa\appdata\local\programs\python\python37\python.exe -DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\Users\prasa\AppData\Local\Temp\pip-install-08cdgdia\dlib\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\prasa\AppData\Local\Temp\pip-install-08cdgdia\dlib\setup.py", line 262, in <module>
'Topic :: Software Development',
File "c:\users\prasa\appdata\local\programs\python\python37\lib\site-packages\setuptools\__init__.py", line 144, in setup
return distutils.core.setup(**attrs)
File "c:\users\prasa\appdata\local\programs\python\python37\lib\distutils\core.py", line 148, in setup
dist.run_commands()
File "c:\users\prasa\appdata\local\programs\python\python37\lib\distutils\dist.py", line 966, in run_commands
self.run_command(cmd)
File "c:\users\prasa\appdata\local\programs\python\python37\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "c:\users\prasa\appdata\local\programs\python\python37\lib\site-packages\setuptools\command\install.py", line 61, in run
return orig.install.run(self)
File "c:\users\prasa\appdata\local\programs\python\python37\lib\distutils\command\install.py", line 545, in run
self.run_command('build')
File "c:\users\prasa\appdata\local\programs\python\python37\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "c:\users\prasa\appdata\local\programs\python\python37\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "c:\users\prasa\appdata\local\programs\python\python37\lib\distutils\command\build.py", line 135, in run
self.run_command(cmd_name)
File "c:\users\prasa\appdata\local\programs\python\python37\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "c:\users\prasa\appdata\local\programs\python\python37\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\Users\prasa\AppData\Local\Temp\pip-install-08cdgdia\dlib\setup.py", line 135, in run
self.build_extension(ext)
File "C:\Users\prasa\AppData\Local\Temp\pip-install-08cdgdia\dlib\setup.py", line 172, in build_extension
subprocess.check_call(cmake_setup, cwd=build_folder)
File "c:\users\prasa\appdata\local\programs\python\python37\lib\subprocess.py", line 363, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', 'C:\\Users\\prasa\\AppData\\Local\\Temp\\pip-install-08cdgdia\\dlib\\tools\\python', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\\Users\\prasa\\AppData\\Local\\Temp\\pip-install-08cdgdia\\dlib\\build\\lib.win-amd64-3.7', '-DPYTHON_EXECUTABLE=c:\\users\\prasa\\appdata\\local\\programs\\python\\python37\\python.exe', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\\Users\\prasa\\AppData\\Local\\Temp\\pip-install-08cdgdia\\dlib\\build\\lib.win-amd64-3.7', '-A', 'x64']' returned non-zero exit status 1.
----------------------------------------
ERROR: Command errored out with exit status 1: 'c:\users\prasa\appdata\local\programs\python\python37\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\prasa\\AppData\\Local\\Temp\\pip-install-08cdgdia\\dlib\\setup.py'"'"'; __file__='"'"'C:\\Users\\prasa\\AppData\\Local\\Temp\\pip-install-08cdgdia\\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\prasa\AppData\Local\Temp\pip-record-h34wkq_s\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\users\prasa\appdata\local\programs\python\python37\Include\dlib' Check the logs for full command output.

Import package face_recognition

I am trying to install face_recognition package but it still shoots an error.
I have installed cmake and tried doing it again but it still does not work:
!pip install cmake
!pip install face_recognition
The installation works. But when I import face_recognition it says module not found.
Collecting face_recognition
Using cached https://files.pythonhosted.org/packages/3f/ed/ad9a28042f373d4633fc8b49109b623597d6f193d3bbbef7780a5ee8eef2/face_recognition-1.2.3-py2.py3-none-any.whl
Requirement already satisfied: numpy in c:\users\pratyush\anaconda2\lib\site-packages (from face_recognition) (1.16.2)
Requirement already satisfied: Click>=6.0 in c:\users\pratyush\anaconda2\lib\site-packages (from face_recognition) (7.0)
Requirement already satisfied: face-recognition-models>=0.3.0 in c:\users\pratyush\anaconda2\lib\site-packages (from face_recognition) (0.3.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 c:\users\pratyush\anaconda2\lib\site-packages (from face_recognition) (5.4.1)
Building wheels for collected packages: dlib
Building wheel for dlib (setup.py): started
Building wheel for dlib (setup.py): finished with status 'error'
Complete output from command C:\Users\Pratyush\Anaconda2\python.exe -u -c "import setuptools, tokenize;file='c:\users\pratyush\appdata\local\temp\pip-install-oeubb_\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\pratyush\appdata\local\temp\pip-wheel-qxe9rn --python-tag cp27:
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 2.7.16 |Anaconda, Inc.| (default, Mar 14 2019, 15:42:17) [MSC v.1500 64 bit (AMD64)]
Invoking CMake setup: 'cmake c:\users\pratyush\appdata\local\temp\pip-install-oeubb_\dlib\tools\python -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=c:\users\pratyush\appdata\local\temp\pip-install-oeubb_\dlib\build\lib.win-amd64-2.7 -DPYTHON_EXECUTABLE=C:\Users\Pratyush\Anaconda2\python.exe -DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=c:\users\pratyush\appdata\local\temp\pip-install-oeubb_\dlib\build\lib.win-amd64-2.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/Pratyush/AppData/Local/Temp/pip-install-oeubb_/dlib/build/temp.win-amd64-2.7/Release/CMakeFiles/CMakeOutput.log".
Traceback (most recent call last):
File "", line 1, in
File "c:\users\pratyush\appdata\local\temp\pip-install-oeubb_\dlib\setup.py", line 261, in
'Topic :: Software Development',
File "C:\Users\Pratyush\Anaconda2\lib\site-packages\setuptools__init__.py", line 145, in setup
return distutils.core.setup(**attrs)
File "C:\Users\Pratyush\Anaconda2\lib\distutils\core.py", line 151, in setup
dist.run_commands()
File "C:\Users\Pratyush\Anaconda2\lib\distutils\dist.py", line 953, in run_commands
self.run_command(cmd)
File "C:\Users\Pratyush\Anaconda2\lib\distutils\dist.py", line 972, in run_command
cmd_obj.run()
File "C:\Users\Pratyush\Anaconda2\lib\site-packages\wheel\bdist_wheel.py", line 192, in run
self.run_command('build')
File "C:\Users\Pratyush\Anaconda2\lib\distutils\cmd.py", line 326, in run_command
self.distribution.run_command(command)
File "C:\Users\Pratyush\Anaconda2\lib\distutils\dist.py", line 972, in run_command
cmd_obj.run()
File "C:\Users\Pratyush\Anaconda2\lib\distutils\command\build.py", line 127, in run
self.run_command(cmd_name)
File "C:\Users\Pratyush\Anaconda2\lib\distutils\cmd.py", line 326, in run_command
self.distribution.run_command(command)
File "C:\Users\Pratyush\Anaconda2\lib\distutils\dist.py", line 972, in run_command
cmd_obj.run()
File "c:\users\pratyush\appdata\local\temp\pip-install-oeubb_\dlib\setup.py", line 135, in run
self.build_extension(ext)
File "c:\users\pratyush\appdata\local\temp\pip-install-oeubb_\dlib\setup.py", line 172, in build_extension
subprocess.check_call(cmake_setup, cwd=build_folder)
File "C:\Users\Pratyush\Anaconda2\lib\subprocess.py", line 190, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', 'c:\users\pratyush\appdata\local\temp\pip-install-oeubb_\dlib\tools\python', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=c:\users\pratyush\appdata\local\temp\pip-install-oeubb_\dlib\build\lib.win-amd64-2.7', '-DPYTHON_EXECUTABLE=C:\Users\Pratyush\Anaconda2\python.exe', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=c:\users\pratyush\appdata\local\temp\pip-install-oeubb_\dlib\build\lib.win-amd64-2.7', '-A', 'x64']' returned non-zero exit status 1
Running setup.py clean for dlib
Failed to build dlib
Installing collected packages: dlib, face-recognition
Running setup.py install for dlib: started
Running setup.py install for dlib: finished with status 'error'
Complete output from command C:\Users\Pratyush\Anaconda2\python.exe -u -c "import setuptools, tokenize;file='c:\users\pratyush\appdata\local\temp\pip-install-oeubb_\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\pratyush\appdata\local\temp\pip-record-mm4zcw\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 2.7.16 |Anaconda, Inc.| (default, Mar 14 2019, 15:42:17) [MSC v.1500 64 bit (AMD64)]
Invoking CMake setup: 'cmake c:\users\pratyush\appdata\local\temp\pip-install-oeubb_\dlib\tools\python -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=c:\users\pratyush\appdata\local\temp\pip-install-oeubb_\dlib\build\lib.win-amd64-2.7 -DPYTHON_EXECUTABLE=C:\Users\Pratyush\Anaconda2\python.exe -DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=c:\users\pratyush\appdata\local\temp\pip-install-oeubb_\dlib\build\lib.win-amd64-2.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/Pratyush/AppData/Local/Temp/pip-install-oeubb_/dlib/build/temp.win-amd64-2.7/Release/CMakeFiles/CMakeOutput.log".
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "c:\users\pratyush\appdata\local\temp\pip-install-oeubb_\dlib\setup.py", line 261, in <module>
'Topic :: Software Development',
File "C:\Users\Pratyush\Anaconda2\lib\site-packages\setuptools\__init__.py", line 145, in setup
return distutils.core.setup(**attrs)
File "C:\Users\Pratyush\Anaconda2\lib\distutils\core.py", line 151, in setup
dist.run_commands()
File "C:\Users\Pratyush\Anaconda2\lib\distutils\dist.py", line 953, in run_commands
self.run_command(cmd)
File "C:\Users\Pratyush\Anaconda2\lib\distutils\dist.py", line 972, in run_command
cmd_obj.run()
File "C:\Users\Pratyush\Anaconda2\lib\site-packages\setuptools\command\install.py", line 61, in run
return orig.install.run(self)
File "C:\Users\Pratyush\Anaconda2\lib\distutils\command\install.py", line 563, in run
self.run_command('build')
File "C:\Users\Pratyush\Anaconda2\lib\distutils\cmd.py", line 326, in run_command
self.distribution.run_command(command)
File "C:\Users\Pratyush\Anaconda2\lib\distutils\dist.py", line 972, in run_command
cmd_obj.run()
File "C:\Users\Pratyush\Anaconda2\lib\distutils\command\build.py", line 127, in run
self.run_command(cmd_name)
File "C:\Users\Pratyush\Anaconda2\lib\distutils\cmd.py", line 326, in run_command
self.distribution.run_command(command)
File "C:\Users\Pratyush\Anaconda2\lib\distutils\dist.py", line 972, in run_command
cmd_obj.run()
File "c:\users\pratyush\appdata\local\temp\pip-install-oeubb_\dlib\setup.py", line 135, in run
self.build_extension(ext)
File "c:\users\pratyush\appdata\local\temp\pip-install-oeubb_\dlib\setup.py", line 172, in build_extension
subprocess.check_call(cmake_setup, cwd=build_folder)
File "C:\Users\Pratyush\Anaconda2\lib\subprocess.py", line 190, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', 'c:\\users\\pratyush\\appdata\\local\\temp\\pip-install-oeubb_\\dlib\\tools\\python', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=c:\\users\\pratyush\\appdata\\local\\temp\\pip-install-oeubb_\\dlib\\build\\lib.win-amd64-2.7', '-DPYTHON_EXECUTABLE=C:\\Users\\Pratyush\\Anaconda2\\python.exe', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=c:\\users\\pratyush\\appdata\\local\\temp\\pip-install-oeubb_\\dlib\\build\\lib.win-amd64-2.7', '-A', 'x64']' returned non-zero exit status 1
THE ERROR MESSAGE

How to fix pip install error for all modules?

I have been trying to install beeware all day, but I keep getting the error
failed with error code 1 in C:\Users\dmcga\AppData\Local\Temp\pip-install-
snn9ad__\pythonnet\
Seeing that this error had something to do with pythonnet, I tried installing that using
pip install pythonnet
I then get the same error, I'll paste everything cmd says below
C:\Users\dmcga>pip install pythonnet
Collecting pythonnet
Using cached
https://files.pythonhosted.org/packages/89/3b/
a22cd45b591d6cf490ee8b24d52b9db1f30b4b478b64a9b231c53474731e/pythonnet-
2.3.0.tar.gz
Installing collected packages: pythonnet
Running setup.py install for pythonnet ... error
Complete output from command
c:\users\dmcga\appdata\local\programs\python\python37-32\python.exe -u -c
"import setuptools,
tokenize;__file__='C:\\Users\\dmcga\\AppData\\Local\\Temp\\pip-install-
snn9ad__\\pythonnet\\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\dmcga\AppData\Local\Temp\pip-
record-33b2bjj0\install-record.txt --single-version-externally-managed --
compile:
running install
running build
running build_ext
Checking for updates from https://www.nuget.org/api/v2/.
Currently running NuGet.exe 3.5.0.
Updating NuGet.exe to 4.9.2.
Update successful.
MSBuild auto-detection: using msbuild version '4.0' from
'C:\Windows\Microsoft.NET\Framework64\v4.0.30319'.
Restoring NuGet package NUnit.3.6.0.
Restoring NuGet package UnmanagedExports.1.2.7.
Restoring NuGet package NUnit.ConsoleRunner.3.6.0.
Adding package 'UnmanagedExports.1.2.7' to folder
'C:\Users\dmcga\AppData\Local\Temp\pip-install-snn9ad__\pythonnet\packages'
Adding package 'NUnit.3.6.0' to folder
'C:\Users\dmcga\AppData\Local\Temp\pip-install-snn9ad__\pythonnet\packages'
Adding package 'NUnit.ConsoleRunner.3.6.0' to folder
'C:\Users\dmcga\AppData\Local\Temp\pip-install-snn9ad__\pythonnet\packages'
Added package 'UnmanagedExports.1.2.7' to folder
'C:\Users\dmcga\AppData\Local\Temp\pip-install-snn9ad__\pythonnet\packages'
Added package 'NUnit.ConsoleRunner.3.6.0' to folder
'C:\Users\dmcga\AppData\Local\Temp\pip-install-snn9ad__\pythonnet\packages'
Added package 'NUnit.3.6.0' to folder
'C:\Users\dmcga\AppData\Local\Temp\pip-install-snn9ad__\pythonnet\packages'
NuGet Config files used:
C:\Users\dmcga\AppData\Roaming\NuGet\NuGet.Config
Feeds used:
C:\Users\dmcga\.nuget\packages\
https://api.nuget.org/v3/index.json
Installed:
3 package(s) to packages.config projects
Traceback (most recent call last):
File "tools\geninterop\geninterop.py", line 24, in <module>
from pycparser import c_ast, c_parser
ModuleNotFoundError: No module named 'pycparser'
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\dmcga\AppData\Local\Temp\pip-install-
snn9ad__\pythonnet\setup.py", line 405, in <module>
zip_safe=False,
File "c:\users\dmcga\appdata\local\programs\python\python37-32\lib\site-
packages\setuptools\__init__.py", line 143, in setup
return distutils.core.setup(**attrs)
File "c:\users\dmcga\appdata\local\programs\python\python37-
32\lib\distutils\core.py", line 148, in setup
dist.run_commands()
File "c:\users\dmcga\appdata\local\programs\python\python37-
32\lib\distutils\dist.py", line 966, in run_commands
self.run_command(cmd)
File "c:\users\dmcga\appdata\local\programs\python\python37-
32\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "c:\users\dmcga\appdata\local\programs\python\python37-32\lib\site-
packages\setuptools\command\install.py", line 61, in run
return orig.install.run(self)
File "c:\users\dmcga\appdata\local\programs\python\python37-
32\lib\distutils\command\install.py", line 545, in run
self.run_command('build')
File "c:\users\dmcga\appdata\local\programs\python\python37-
32\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "c:\users\dmcga\appdata\local\programs\python\python37-
32\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "c:\users\dmcga\appdata\local\programs\python\python37-
32\lib\distutils\command\build.py", line 135, in run
self.run_command(cmd_name)
File "c:\users\dmcga\appdata\local\programs\python\python37-
32\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "c:\users\dmcga\appdata\local\programs\python\python37-
32\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "c:\users\dmcga\appdata\local\programs\python\python37-
32\lib\distutils\command\build_ext.py", line 339, in run
self.build_extensions()
File "c:\users\dmcga\appdata\local\programs\python\python37-
32\lib\distutils\command\build_ext.py", line 448, in build_extensions
self._build_extensions_serial()
File "c:\users\dmcga\appdata\local\programs\python\python37-
32\lib\distutils\command\build_ext.py", line 473, in
_build_extensions_serial
self.build_extension(ext)
File "C:\Users\dmcga\AppData\Local\Temp\pip-install-
snn9ad__\pythonnet\setup.py", line 191, in build_extension
subprocess.check_call([sys.executable, geninterop, interop_file])
File "c:\users\dmcga\appdata\local\programs\python\python37-
32\lib\subprocess.py", line 347, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command
'['c:\\users\\dmcga\\appdata\\local\\programs\\python\\python37-
32\\python.exe', 'tools\\geninterop\\geninterop.py',
'src\\runtime\\interop37.cs']' returned non-zero exit status 1.
----------------------------------------
Command "c:\users\dmcga\appdata\local\programs\python\python37-32\python.exe
-u -c "import setuptools,
tokenize;__file__='C:\\Users\\dmcga\\AppData\\Local\\Temp\\pip-install-
snn9ad__\\pythonnet\\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\dmcga\AppData\Local\Temp\pip-
record-33b2bjj0\install-record.txt --single-version-externally-managed --
compile" failed with error code 1 in C:\Users\dmcga\AppData\Local\Temp\pip-
install-snn9ad__\pythonnet\
I am using Python 3.7, pip 19.0.1, Windows 10
This seems to be occurring with almost all modules that I attempt to install, I tried a fresh install of python, but still am getting this error.

Categories