Not able to install dlib on Windows 10 and Python 3.7 - python-3.x

I am trying to install OpenCV, dlib on Windows 10 on Anaconda Python 3.7.
I have installed Visual studio 2015 as prerequisite along with CMake. When I am trying to install dlib on my computer it is giving me below error. I am also not able to install OpenCV. I tried installing the dlib using .whl file. But, still no luck.
Collecting dlib
Using cached https://files.pythonhosted.org/packages/1e/62/aacb236d21fbd08148b1d517d58a9d80ea31bdcd386d26f21f8b23b1eb28/dlib-19.18.0.tar.gz
Building wheels for collected packages: dlib
Building wheel for dlib (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: 'C:\Users\dbi227\AppData\Local\Continuum\anaconda3\envs\opencv-env\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\dbi227\\AppData\\Local\\Temp\\pip-install-9vjrsx_l\\dlib\\setup.py'"'"'; __file__='"'"'C:\\Users\\dbi227\\AppData\\Local\\Temp\\pip-install-9vjrsx_l\\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\dbi227\AppData\Local\Temp\pip-wheel-2nm313mu' --python-tag cp37
cwd: C:\Users\dbi227\AppData\Local\Temp\pip-install-9vjrsx_l\dlib\
Complete output (73 lines):
running bdist_wheel
running build
running build_py
package init file 'dlib\__init__.py' not found (or not a regular file)
running build_ext
Building extension for Python 3.7.4 (default, Aug 9 2019, 18:34:13) [MSC v.1915 64 bit (AMD64)]
Invoking CMake setup: 'cmake C:\Users\dbi227\AppData\Local\Temp\pip-install-9vjrsx_l\dlib\tools\python -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\Users\dbi227\AppData\Local\Temp\pip-install-9vjrsx_l\dlib\build\lib.win-amd64-3.7 -DPYTHON_EXECUTABLE=C:\Users\dbi227\AppData\Local\Continuum\anaconda3\envs\opencv-env\python.exe -DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\Users\dbi227\AppData\Local\Temp\pip-install-9vjrsx_l\dlib\build\lib.win-amd64-3.7 -A x64'
-- Building for: Visual Studio 14 2015
-- Selecting Windows SDK version to target Windows 10.0.17763.
CMake Error at CMakeLists.txt:3 (project):
Failed to run MSBuild command:
C:/Program Files (x86)/MSBuild/14.0/bin/MSBuild.exe
to get the value of VCTargetsPath:
Microsoft (R) Build Engine version 14.0.25420.1
Copyright (C) Microsoft Corporation. All rights reserved.
Build started 10/23/2019 9:27:01 AM.
Project "C:\Users\dbi227\AppData\Local\Temp\pip-install-9vjrsx_l\dlib\build\temp.win-amd64-3.7\Release\CMakeFiles\3.15.3\VCTargetsPath.vcxproj" on node 1 (default targets).
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Platforms\x64\PlatformToolsets\v140\Toolset.targets(36,5): error MSB8036: The Windows SDK version 8.1 was not found. Install the required version of Windows SDK or change the SDK version in the project property pages or by right-clicking the solution and selecting "Retarget solution". [C:\Users\dbi227\AppData\Local\Temp\pip-install-9vjrsx_l\dlib\build\temp.win-amd64-3.7\Release\CMakeFiles\3.15.3\VCTargetsPath.vcxproj]
Done Building Project "C:\Users\dbi227\AppData\Local\Temp\pip-install-9vjrsx_l\dlib\build\temp.win-amd64-3.7\Release\CMakeFiles\3.15.3\VCTargetsPath.vcxproj" (default targets) -- FAILED.
Build FAILED.
"C:\Users\dbi227\AppData\Local\Temp\pip-install-9vjrsx_l\dlib\build\temp.win-amd64-3.7\Release\CMakeFiles\3.15.3\VCTargetsPath.vcxproj" (default target) (1) ->
(Desktop_PlatformPrepareForBuild target) ->
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Platforms\x64\PlatformToolsets\v140\Toolset.targets(36,5): error MSB8036: The Windows SDK version 8.1 was not found. Install the required version of Windows SDK or change the SDK version in the project property pages or by right-clicking the solution and selecting "Retarget solution". [C:\Users\dbi227\AppData\Local\Temp\pip-install-9vjrsx_l\dlib\build\temp.win-amd64-3.7\Release\CMakeFiles\3.15.3\VCTargetsPath.vcxproj]
0 Warning(s)
1 Error(s)
Time Elapsed 00:00:00.51
Exit code: 1
-- Configuring incomplete, errors occurred!
See also "C:/Users/dbi227/AppData/Local/Temp/pip-install-9vjrsx_l/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\dbi227\AppData\Local\Temp\pip-install-9vjrsx_l\dlib\setup.py", line 261, in <module>
'Topic :: Software Development',
File "C:\Users\dbi227\AppData\Local\Continuum\anaconda3\envs\opencv-env\lib\site-packages\setuptools\__init__.py", line 145, in setup
return distutils.core.setup(**attrs)
File "C:\Users\dbi227\AppData\Local\Continuum\anaconda3\envs\opencv-env\lib\distutils\core.py", line 148, in setup
dist.run_commands()
File "C:\Users\dbi227\AppData\Local\Continuum\anaconda3\envs\opencv-env\lib\distutils\dist.py", line 966, in run_commands
self.run_command(cmd)
File "C:\Users\dbi227\AppData\Local\Continuum\anaconda3\envs\opencv-env\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\Users\dbi227\AppData\Local\Continuum\anaconda3\envs\opencv-env\lib\site-packages\wheel\bdist_wheel.py", line 192, in run
self.run_command('build')
File "C:\Users\dbi227\AppData\Local\Continuum\anaconda3\envs\opencv-env\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "C:\Users\dbi227\AppData\Local\Continuum\anaconda3\envs\opencv-env\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\Users\dbi227\AppData\Local\Continuum\anaconda3\envs\opencv-env\lib\distutils\command\build.py", line 135, in run
self.run_command(cmd_name)
File "C:\Users\dbi227\AppData\Local\Continuum\anaconda3\envs\opencv-env\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "C:\Users\dbi227\AppData\Local\Continuum\anaconda3\envs\opencv-env\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\Users\dbi227\AppData\Local\Temp\pip-install-9vjrsx_l\dlib\setup.py", line 135, in run
self.build_extension(ext)
File "C:\Users\dbi227\AppData\Local\Temp\pip-install-9vjrsx_l\dlib\setup.py", line 172, in build_extension
subprocess.check_call(cmake_setup, cwd=build_folder)
File "C:\Users\dbi227\AppData\Local\Continuum\anaconda3\envs\opencv-env\lib\subprocess.py", line 347, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', 'C:\\Users\\dbi227\\AppData\\Local\\Temp\\pip-install-9vjrsx_l\\dlib\\tools\\python', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\\Users\\dbi227\\AppData\\Local\\Temp\\pip-install-9vjrsx_l\\dlib\\build\\lib.win-amd64-3.7', '-DPYTHON_EXECUTABLE=C:\\Users\\dbi227\\AppData\\Local\\Continuum\\anaconda3\\envs\\opencv-env\\python.exe', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\\Users\\dbi227\\AppData\\Local\\Temp\\pip-install-9vjrsx_l\\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: Command errored out with exit status 1:
command: 'C:\Users\dbi227\AppData\Local\Continuum\anaconda3\envs\opencv-env\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\dbi227\\AppData\\Local\\Temp\\pip-install-9vjrsx_l\\dlib\\setup.py'"'"'; __file__='"'"'C:\\Users\\dbi227\\AppData\\Local\\Temp\\pip-install-9vjrsx_l\\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\dbi227\AppData\Local\Temp\pip-record-3ic8n66v\install-record.txt' --single-version-externally-managed --compile
cwd: C:\Users\dbi227\AppData\Local\Temp\pip-install-9vjrsx_l\dlib\
Complete output (75 lines):
running install
running build
running build_py
package init file 'dlib\__init__.py' not found (or not a regular file)
running build_ext
Building extension for Python 3.7.4 (default, Aug 9 2019, 18:34:13) [MSC v.1915 64 bit (AMD64)]
Invoking CMake setup: 'cmake C:\Users\dbi227\AppData\Local\Temp\pip-install-9vjrsx_l\dlib\tools\python -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\Users\dbi227\AppData\Local\Temp\pip-install-9vjrsx_l\dlib\build\lib.win-amd64-3.7 -DPYTHON_EXECUTABLE=C:\Users\dbi227\AppData\Local\Continuum\anaconda3\envs\opencv-env\python.exe -DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\Users\dbi227\AppData\Local\Temp\pip-install-9vjrsx_l\dlib\build\lib.win-amd64-3.7 -A x64'
-- Building for: Visual Studio 14 2015
-- Selecting Windows SDK version to target Windows 10.0.17763.
CMake Error at CMakeLists.txt:3 (project):
Failed to run MSBuild command:
C:/Program Files (x86)/MSBuild/14.0/bin/MSBuild.exe
to get the value of VCTargetsPath:
Microsoft (R) Build Engine version 14.0.25420.1
Copyright (C) Microsoft Corporation. All rights reserved.
Build started 10/23/2019 9:27:03 AM.
Project "C:\Users\dbi227\AppData\Local\Temp\pip-install-9vjrsx_l\dlib\build\temp.win-amd64-3.7\Release\CMakeFiles\3.15.3\VCTargetsPath.vcxproj" on node 1 (default targets).
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Platforms\x64\PlatformToolsets\v140\Toolset.targets(36,5): error MSB8036: The Windows SDK version 8.1 was not found. Install the required version of Windows SDK or change the SDK version in the project property pages or by right-clicking the solution and selecting "Retarget solution". [C:\Users\dbi227\AppData\Local\Temp\pip-install-9vjrsx_l\dlib\build\temp.win-amd64-3.7\Release\CMakeFiles\3.15.3\VCTargetsPath.vcxproj]
Done Building Project "C:\Users\dbi227\AppData\Local\Temp\pip-install-9vjrsx_l\dlib\build\temp.win-amd64-3.7\Release\CMakeFiles\3.15.3\VCTargetsPath.vcxproj" (default targets) -- FAILED.
Build FAILED.
"C:\Users\dbi227\AppData\Local\Temp\pip-install-9vjrsx_l\dlib\build\temp.win-amd64-3.7\Release\CMakeFiles\3.15.3\VCTargetsPath.vcxproj" (default target) (1) ->
(Desktop_PlatformPrepareForBuild target) ->
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Platforms\x64\PlatformToolsets\v140\Toolset.targets(36,5): error MSB8036: The Windows SDK version 8.1 was not found. Install the required version of Windows SDK or change the SDK version in the project property pages or by right-clicking the solution and selecting "Retarget solution". [C:\Users\dbi227\AppData\Local\Temp\pip-install-9vjrsx_l\dlib\build\temp.win-amd64-3.7\Release\CMakeFiles\3.15.3\VCTargetsPath.vcxproj]
0 Warning(s)
1 Error(s)
Time Elapsed 00:00:00.10
Exit code: 1
-- Configuring incomplete, errors occurred!
See also "C:/Users/dbi227/AppData/Local/Temp/pip-install-9vjrsx_l/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\dbi227\AppData\Local\Temp\pip-install-9vjrsx_l\dlib\setup.py", line 261, in <module>
'Topic :: Software Development',
File "C:\Users\dbi227\AppData\Local\Continuum\anaconda3\envs\opencv-env\lib\site-packages\setuptools\__init__.py", line 145, in setup
return distutils.core.setup(**attrs)
File "C:\Users\dbi227\AppData\Local\Continuum\anaconda3\envs\opencv-env\lib\distutils\core.py", line 148, in setup
dist.run_commands()
File "C:\Users\dbi227\AppData\Local\Continuum\anaconda3\envs\opencv-env\lib\distutils\dist.py", line 966, in run_commands
self.run_command(cmd)
File "C:\Users\dbi227\AppData\Local\Continuum\anaconda3\envs\opencv-env\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\Users\dbi227\AppData\Local\Continuum\anaconda3\envs\opencv-env\lib\site-packages\setuptools\command\install.py", line 61, in run
return orig.install.run(self)
File "C:\Users\dbi227\AppData\Local\Continuum\anaconda3\envs\opencv-env\lib\distutils\command\install.py", line 545, in run
self.run_command('build')
File "C:\Users\dbi227\AppData\Local\Continuum\anaconda3\envs\opencv-env\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "C:\Users\dbi227\AppData\Local\Continuum\anaconda3\envs\opencv-env\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\Users\dbi227\AppData\Local\Continuum\anaconda3\envs\opencv-env\lib\distutils\command\build.py", line 135, in run
self.run_command(cmd_name)
File "C:\Users\dbi227\AppData\Local\Continuum\anaconda3\envs\opencv-env\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "C:\Users\dbi227\AppData\Local\Continuum\anaconda3\envs\opencv-env\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\Users\dbi227\AppData\Local\Temp\pip-install-9vjrsx_l\dlib\setup.py", line 135, in run
self.build_extension(ext)
File "C:\Users\dbi227\AppData\Local\Temp\pip-install-9vjrsx_l\dlib\setup.py", line 172, in build_extension
subprocess.check_call(cmake_setup, cwd=build_folder)
File "C:\Users\dbi227\AppData\Local\Continuum\anaconda3\envs\opencv-env\lib\subprocess.py", line 347, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', 'C:\\Users\\dbi227\\AppData\\Local\\Temp\\pip-install-9vjrsx_l\\dlib\\tools\\python', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\\Users\\dbi227\\AppData\\Local\\Temp\\pip-install-9vjrsx_l\\dlib\\build\\lib.win-amd64-3.7', '-DPYTHON_EXECUTABLE=C:\\Users\\dbi227\\AppData\\Local\\Continuum\\anaconda3\\envs\\opencv-env\\python.exe', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\\Users\\dbi227\\AppData\\Local\\Temp\\pip-install-9vjrsx_l\\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\dbi227\AppData\Local\Continuum\anaconda3\envs\opencv-env\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\dbi227\\AppData\\Local\\Temp\\pip-install-9vjrsx_l\\dlib\\setup.py'"'"'; __file__='"'"'C:\\Users\\dbi227\\AppData\\Local\\Temp\\pip-install-9vjrsx_l\\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\dbi227\AppData\Local\Temp\pip-record-3ic8n66v\install-record.txt' --single-version-externally-managed --compile Check the logs for full command output.

I had the problem with anaconda channel for this package. Current version from anaconda requires Python <=3.6.
I used pip channel instead of anaconda. By
pip install dlib
Before installing via pip, please make sure that you are using current environments pip by
which pip
This should output something like /home/user_name/anaconda3/envs/env_name/bin/pip

I tried so many things to work with the latest version of Anaconda which is Python 3.7. However, I was unable to do so. Because none of the .whl file were compatible with Python 3.7, but with Python 3.6. So, I followed the link to downgrade the Python version to 3.6. This way spyder as well as Python would be downgraded to the 3.6 version. Once I had done so, I installed OpenCV using the below commands.
pip install opencv-python
pip install opencv-contrib-python
I installed dlib using the following command.
pip install dlib-19.8.1-cp36-cp36m-win_amd64.whl
This successfully installed the latest version of dlib.
To check if everything got installed properly, the commands I used and the output I got on Anaconda prompt was as follows.
(py36) C:\Users\dbi227> python
Python 3.6.9 |Anaconda, Inc.| (default, Jul 30 2019, 14:00:49) [MSC v.1915 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import cv2
>>> cv2.__version__
'4.1.1'
>>> import dlib
>>> dlib.__version__
'19.8.1'
It is important to check if your iPython installation is also downgraded to 3.6 or not. For that, I got an option spyder(py36) apart from spyder(anaconda3) on my start option. Make sure you click on spyder(py36). Because that is the one where the libraries are installed. To check it, you can just type:
import cv2
import dlib
If these commands do not show any error, then the libraries are correctly installed.

You need to compile it. Install Visual Studio 2019 and CMake.
Then go to folder of your dlib, open the terminal and use the command
python3 setup.py sdist bdist_wheel
It will load lots of text, and then you will have a wheel file in your dist folder. Make sure your Python 3.7.2 corresponds to the dlib version.
In the end, all you need to do is pip install cp37.whl

No need to downgrade Python to 3.6.x
The best way to do it on Windows (if you find installing all the huge Visual Studio just to build dlib is too much overkill -- I feel so), is to create another environment in conda then install dlib. Why? Because we'll need prebuilt wheel (whl) file for Windows with:
conda install -c conda-forge dlib
and that trigger a environment checking/dependency checking, etc, packages will be upgraded/downgraded/removed/etc., and will pretty much likely will have unwanted impact to your base environment. So creating environment will save you from headaches when we have packages conflict. conda will manage the dependencies for you.

You can install dlib through one of .whl files available here: https://pypi.org/simple/dlib/
For example, if you want to install dlib for Windows 64 bit version and for Python 3.6 then download this dlib-19.8.1-cp36-cp36m-win_amd64.whl
and install it
using
pip3 install dlib-19.8.1-cp36-cp36m-win_amd64.whl
Note: Please verify the Python version and Operating system accordingly.

Related

unable to install dlib on python 3

Im trying to installing dlib on python 3.7 but it always failed
I've installed the cmake and add it to my environment, i've upgraded my pip into the latest version,
but everytime i run
pip install dlib
It returns error as
Collecting dlib
Using cached dlib-19.19.0.tar.gz (3.2 MB)
Installing collected packages: dlib
Running setup.py install for dlib ... error
ERROR: Command errored out with exit status 1:
command: 'c:\users\charles\appdata\local\programs\python\python37\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Charles\\AppData\\Local\\Temp\\pip-install-6wd_c0pw\\dlib\\setup.py'"'"'; __file__='"'"'C:\\Users\\Charles\\AppData\\Local\\Temp\\pip-install-6wd_c0pw\\dlib\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\Charles\AppData\Local\Temp\pip-record-xchasbrx\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\users\charles\appdata\local\programs\python\python37\Include\dlib'
cwd: C:\Users\Charles\AppData\Local\Temp\pip-install-6wd_c0pw\dlib\
Complete output (74 lines):
running install
running build
running build_py
package init file 'dlib\__init__.py' not found (or not a regular file)
running build_ext
Building extension for Python 3.7.4 (tags/v3.7.4:e09359112e, Jul 8 2019, 20:34:20) [MSC v.1916 64 bit (AMD64)]
Invoking CMake setup: 'cmake C:\Users\Charles\AppData\Local\Temp\pip-install-6wd_c0pw\dlib\tools\python -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\Users\Charles\AppData\Local\Temp\pip-install-6wd_c0pw\dlib\build\lib.win-amd64-3.7 -DPYTHON_EXECUTABLE=c:\users\charles\appdata\local\programs\python\python37\python.exe -DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\Users\Charles\AppData\Local\Temp\pip-install-6wd_c0pw\dlib\build\lib.win-amd64-3.7 -A x64'
-- Building for: Visual Studio 10 2010
CMake Error at CMakeLists.txt:3 (project):
Failed to run MSBuild command:
C:/Windows/Microsoft.NET/Framework/v4.0.30319/MSBuild.exe
to get the value of VCTargetsPath:
Microsoft (R) Build Engine version 4.8.3752.0
[Microsoft .NET Framework, version 4.0.30319.42000]
Copyright (C) Microsoft Corporation. All rights reserved.
Build started 2/7/2020 12:37:32 PM.
Project "C:\Users\Charles\AppData\Local\Temp\pip-install-6wd_c0pw\dlib\build\temp.win-amd64-3.7\Release\CMakeFiles\3.16.3\VCTargetsPath.vcxproj" on node 1 (default targets).
C:\Users\Charles\AppData\Local\Temp\pip-install-6wd_c0pw\dlib\build\temp.win-amd64-3.7\Release\CMakeFiles\3.16.3\VCTargetsPath.vcxproj(14,2): error MSB4019: The imported project "C:\Microsoft.Cpp.Default.props" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.
Done Building Project "C:\Users\Charles\AppData\Local\Temp\pip-install-6wd_c0pw\dlib\build\temp.win-amd64-3.7\Release\CMakeFiles\3.16.3\VCTargetsPath.vcxproj" (default targets) -- FAILED.
Build FAILED.
"C:\Users\Charles\AppData\Local\Temp\pip-install-6wd_c0pw\dlib\build\temp.win-amd64-3.7\Release\CMakeFiles\3.16.3\VCTargetsPath.vcxproj" (default target) (1) ->
C:\Users\Charles\AppData\Local\Temp\pip-install-6wd_c0pw\dlib\build\temp.win-amd64-3.7\Release\CMakeFiles\3.16.3\VCTargetsPath.vcxproj(14,2): error MSB4019: The imported project "C:\Microsoft.Cpp.Default.props" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.
0 Warning(s)
1 Error(s)
Time Elapsed 00:00:00.01
Exit code: 1
-- Configuring incomplete, errors occurred!
See also "C:/Users/Charles/AppData/Local/Temp/pip-install-6wd_c0pw/dlib/build/temp.win-amd64-3.7/Release/CMakeFiles/CMakeOutput.log".
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\Charles\AppData\Local\Temp\pip-install-6wd_c0pw\dlib\setup.py", line 261, in <module>
'Topic :: Software Development',
File "c:\users\charles\appdata\local\programs\python\python37\lib\site-packages\setuptools\__init__.py", line 145, in setup
return distutils.core.setup(**attrs)
File "c:\users\charles\appdata\local\programs\python\python37\lib\distutils\core.py", line 148, in setup
dist.run_commands()
File "c:\users\charles\appdata\local\programs\python\python37\lib\distutils\dist.py", line 966, in run_commands
self.run_command(cmd)
File "c:\users\charles\appdata\local\programs\python\python37\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "c:\users\charles\appdata\local\programs\python\python37\lib\site-packages\setuptools\command\install.py", line 61, in run
return orig.install.run(self)
File "c:\users\charles\appdata\local\programs\python\python37\lib\distutils\command\install.py", line 545, in run
self.run_command('build')
File "c:\users\charles\appdata\local\programs\python\python37\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "c:\users\charles\appdata\local\programs\python\python37\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "c:\users\charles\appdata\local\programs\python\python37\lib\distutils\command\build.py", line 135, in run
self.run_command(cmd_name)
File "c:\users\charles\appdata\local\programs\python\python37\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "c:\users\charles\appdata\local\programs\python\python37\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\Users\Charles\AppData\Local\Temp\pip-install-6wd_c0pw\dlib\setup.py", line 135, in run
self.build_extension(ext)
File "C:\Users\Charles\AppData\Local\Temp\pip-install-6wd_c0pw\dlib\setup.py", line 172, in build_extension
subprocess.check_call(cmake_setup, cwd=build_folder)
File "c:\users\charles\appdata\local\programs\python\python37\lib\subprocess.py", line 347, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', 'C:\\Users\\Charles\\AppData\\Local\\Temp\\pip-install-6wd_c0pw\\dlib\\tools\\python', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\\Users\\Charles\\AppData\\Local\\Temp\\pip-install-6wd_c0pw\\dlib\\build\\lib.win-amd64-3.7', '-DPYTHON_EXECUTABLE=c:\\users\\charles\\appdata\\local\\programs\\python\\python37\\python.exe', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\\Users\\Charles\\AppData\\Local\\Temp\\pip-install-6wd_c0pw\\dlib\\build\\lib.win-amd64-3.7', '-A', 'x64']' returned non-zero exit status 1.
----------------------------------------
ERROR: Command errored out with exit status 1: 'c:\users\charles\appdata\local\programs\python\python37\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Charles\\AppData\\Local\\Temp\\pip-install-6wd_c0pw\\dlib\\setup.py'"'"'; __file__='"'"'C:\\Users\\Charles\\AppData\\Local\\Temp\\pip-install-6wd_c0pw\\dlib\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\Charles\AppData\Local\Temp\pip-record-xchasbrx\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\users\charles\appdata\local\programs\python\python37\Include\dlib' Check the logs for full command output.
i also installed it by:
go here https://pypi.org/simple/dlib/
pick dlib-19.18.0.tar.gz
extract it, and go into the folder
open command line then run python setup.py install
it returns:
running install
running bdist_egg
running egg_info
writing dlib.egg-info\PKG-INFO
writing dependency_links to dlib.egg-info\dependency_links.txt
writing top-level names to dlib.egg-info\top_level.txt
package init file 'dlib\__init__.py' not found (or not a regular file)
reading manifest file 'dlib.egg-info\SOURCES.txt'
reading manifest template 'MANIFEST.in'
no previously-included directories found matching 'tools\python\build*'
no previously-included directories found matching 'dlib\test'
writing manifest file 'dlib.egg-info\SOURCES.txt'
installing library code to build\bdist.win-amd64\egg
running install_lib
running build_py
running build_ext
Building extension for Python 3.7.4 (tags/v3.7.4:e09359112e, Jul 8 2019, 20:34:20) [MSC v.1916 64 bit (AMD64)]
Invoking CMake setup: 'cmake C:\Users\Charles\Downloads\dlib-19.18.0.tar\dist\dlib-19.18.0\tools\python -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\Users\Charles\Downloads\dlib-19.18.0.tar\dist\dlib-19.18.0\build\lib.win-amd64-3.7 -DPYTHON_EXECUTABLE=C:\Users\Charles\AppData\Local\Programs\Python\Python37\python.exe -DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\Users\Charles\Downloads\dlib-19.18.0.tar\dist\dlib-19.18.0\build\lib.win-amd64-3.7 -A x64'
CMake Error at CMakeLists.txt:3 (project):
Failed to run MSBuild command:
C:/Windows/Microsoft.NET/Framework/v4.0.30319/MSBuild.exe
to get the value of VCTargetsPath:
Microsoft (R) Build Engine version 4.8.3752.0
[Microsoft .NET Framework, version 4.0.30319.42000]
Copyright (C) Microsoft Corporation. All rights reserved.
Build started 2/7/2020 12:21:15 PM.
Project "C:\Users\Charles\Downloads\dlib-19.18.0.tar\dist\dlib-19.18.0\build\temp.win-amd64-3.7\Release\CMakeFiles\3.16.3\VCTargetsPath.vcxproj" on node 1 (default targets).
C:\Users\Charles\Downloads\dlib-19.18.0.tar\dist\dlib-19.18.0\build\temp.win-amd64-3.7\Release\CMakeFiles\3.16.3\VCTargetsPath.vcxproj(14,2): error MSB4019: The imported project "C:\Microsoft.Cpp.Default.props" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.
Done Building Project "C:\Users\Charles\Downloads\dlib-19.18.0.tar\dist\dlib-19.18.0\build\temp.win-amd64-3.7\Release\CMakeFiles\3.16.3\VCTargetsPath.vcxproj" (default targets) -- FAILED.
Build FAILED.
"C:\Users\Charles\Downloads\dlib-19.18.0.tar\dist\dlib-19.18.0\build\temp.win-amd64-3.7\Release\CMakeFiles\3.16.3\VCTargetsPath.vcxproj" (default target) (1) ->
C:\Users\Charles\Downloads\dlib-19.18.0.tar\dist\dlib-19.18.0\build\temp.win-amd64-3.7\Release\CMakeFiles\3.16.3\VCTargetsPath.vcxproj(14,2): error MSB4019: The imported project "C:\Microsoft.Cpp.Default.props" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.
0 Warning(s)
1 Error(s)
Time Elapsed 00:00:00.06
Exit code: 1
-- Configuring incomplete, errors occurred!
See also "C:/Users/Charles/Downloads/dlib-19.18.0.tar/dist/dlib-19.18.0/build/temp.win-amd64-3.7/Release/CMakeFiles/CMakeOutput.log".
Traceback (most recent call last):
File "setup.py", line 261, in <module>
'Topic :: Software Development',
File "C:\Users\Charles\AppData\Local\Programs\Python\Python37\lib\site-packages\setuptools\__init__.py", line 145, in setup
return distutils.core.setup(**attrs)
File "C:\Users\Charles\AppData\Local\Programs\Python\Python37\lib\distutils\core.py", line 148, in setup
dist.run_commands()
File "C:\Users\Charles\AppData\Local\Programs\Python\Python37\lib\distutils\dist.py", line 966, in run_commands
self.run_command(cmd)
File "C:\Users\Charles\AppData\Local\Programs\Python\Python37\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\Users\Charles\AppData\Local\Programs\Python\Python37\lib\site-packages\setuptools\command\install.py", line 67, in run
self.do_egg_install()
File "C:\Users\Charles\AppData\Local\Programs\Python\Python37\lib\site-packages\setuptools\command\install.py", line 109, in do_egg_install
self.run_command('bdist_egg')
File "C:\Users\Charles\AppData\Local\Programs\Python\Python37\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "C:\Users\Charles\AppData\Local\Programs\Python\Python37\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\Users\Charles\AppData\Local\Programs\Python\Python37\lib\site-packages\setuptools\command\bdist_egg.py", line 172, in run
cmd = self.call_command('install_lib', warn_dir=0)
File "C:\Users\Charles\AppData\Local\Programs\Python\Python37\lib\site-packages\setuptools\command\bdist_egg.py", line 158, in call_command
self.run_command(cmdname)
File "C:\Users\Charles\AppData\Local\Programs\Python\Python37\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "C:\Users\Charles\AppData\Local\Programs\Python\Python37\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\Users\Charles\AppData\Local\Programs\Python\Python37\lib\site-packages\setuptools\command\install_lib.py", line 11, in run
self.build()
File "C:\Users\Charles\AppData\Local\Programs\Python\Python37\lib\distutils\command\install_lib.py", line 107, in build
self.run_command('build_ext')
File "C:\Users\Charles\AppData\Local\Programs\Python\Python37\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "C:\Users\Charles\AppData\Local\Programs\Python\Python37\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "setup.py", line 135, in run
self.build_extension(ext)
File "setup.py", line 172, in build_extension
subprocess.check_call(cmake_setup, cwd=build_folder)
File "C:\Users\Charles\AppData\Local\Programs\Python\Python37\lib\subprocess.py", line 347, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', 'C:\\Users\\Charles\\Downloads\\dlib-19.18.0.tar\\dist\\dlib-19.18.0\\tools\\python', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\\Users\\Charles\\Downloads\\dlib-19.18.0.tar\\dist\\dlib-19.18.0\\build\\lib.win-amd64-3.7', '-DPYTHON_EXECUTABLE=C:\\Users\\Charles\\AppData\\Local\\Programs\\Python\\Python37\\python.exe', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\\Users\\Charles\\Downloads\\dlib-19.18.0.tar\\dist\\dlib-19.18.0\\build\\lib.win-amd64-3.7', '-A', 'x64']' returned non-zero exit status 1.
i also tried install it from source as :
python -m pip install https://files.pythonhosted.org/packages/1e/62/aacb236d21fbd08148b1d517d58a9d80ea31bdcd386d26f21f8b23b1eb28/dlib-19.18.0.tar.gz#sha256=8ca127253a0ca82a3d847148515f82ff2c504ed77a6385ec4f38c7f8e5360860
it returning error as
Collecting https://files.pythonhosted.org/packages/1e/62/aacb236d21fbd08148b1d517d58a9d80ea31bdcd386d26f21f8b23b1eb28/dlib-19.18.0.tar.gz#sha256=8ca127253a0ca82a3d847148515f82ff2c504ed77a6385ec4f38c7f8e5360860
Using cached dlib-19.18.0.tar.gz (3.1 MB)
Installing collected packages: dlib
Running setup.py install for dlib ... error
ERROR: Command errored out with exit status 1:
command: 'C:\Users\Charles\AppData\Local\Programs\Python\Python37\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Charles\\AppData\\Local\\Temp\\pip-req-build-k3302dt_\\setup.py'"'"'; __file__='"'"'C:\\Users\\Charles\\AppData\\Local\\Temp\\pip-req-build-k3302dt_\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\Charles\AppData\Local\Temp\pip-record-waso8gw6\install-record.txt' --single-version-externally-managed --compile --install-headers 'C:\Users\Charles\AppData\Local\Programs\Python\Python37\Include\dlib'
cwd: C:\Users\Charles\AppData\Local\Temp\pip-req-build-k3302dt_\
Complete output (74 lines):
running install
running build
running build_py
package init file 'dlib\__init__.py' not found (or not a regular file)
running build_ext
Building extension for Python 3.7.4 (tags/v3.7.4:e09359112e, Jul 8 2019, 20:34:20) [MSC v.1916 64 bit (AMD64)]
Invoking CMake setup: 'cmake C:\Users\Charles\AppData\Local\Temp\pip-req-build-k3302dt_\tools\python -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\Users\Charles\AppData\Local\Temp\pip-req-build-k3302dt_\build\lib.win-amd64-3.7 -DPYTHON_EXECUTABLE=C:\Users\Charles\AppData\Local\Programs\Python\Python37\python.exe -DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\Users\Charles\AppData\Local\Temp\pip-req-build-k3302dt_\build\lib.win-amd64-3.7 -A x64'
-- Building for: Visual Studio 10 2010
CMake Error at CMakeLists.txt:3 (project):
Failed to run MSBuild command:
C:/Windows/Microsoft.NET/Framework/v4.0.30319/MSBuild.exe
to get the value of VCTargetsPath:
Microsoft (R) Build Engine version 4.8.3752.0
[Microsoft .NET Framework, version 4.0.30319.42000]
Copyright (C) Microsoft Corporation. All rights reserved.
Build started 2/7/2020 12:53:19 PM.
Project "C:\Users\Charles\AppData\Local\Temp\pip-req-build-k3302dt_\build\temp.win-amd64-3.7\Release\CMakeFiles\3.16.3\VCTargetsPath.vcxproj" on node 1 (default targets).
C:\Users\Charles\AppData\Local\Temp\pip-req-build-k3302dt_\build\temp.win-amd64-3.7\Release\CMakeFiles\3.16.3\VCTargetsPath.vcxproj(14,2): error MSB4019: The imported project "C:\Microsoft.Cpp.Default.props" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.
Done Building Project "C:\Users\Charles\AppData\Local\Temp\pip-req-build-k3302dt_\build\temp.win-amd64-3.7\Release\CMakeFiles\3.16.3\VCTargetsPath.vcxproj" (default targets) -- FAILED.
Build FAILED.
"C:\Users\Charles\AppData\Local\Temp\pip-req-build-k3302dt_\build\temp.win-amd64-3.7\Release\CMakeFiles\3.16.3\VCTargetsPath.vcxproj" (default target) (1) ->
C:\Users\Charles\AppData\Local\Temp\pip-req-build-k3302dt_\build\temp.win-amd64-3.7\Release\CMakeFiles\3.16.3\VCTargetsPath.vcxproj(14,2): error MSB4019: The imported project "C:\Microsoft.Cpp.Default.props" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.
0 Warning(s)
1 Error(s)
Time Elapsed 00:00:00.01
Exit code: 1
-- Configuring incomplete, errors occurred!
See also "C:/Users/Charles/AppData/Local/Temp/pip-req-build-k3302dt_/build/temp.win-amd64-3.7/Release/CMakeFiles/CMakeOutput.log".
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\Charles\AppData\Local\Temp\pip-req-build-k3302dt_\setup.py", line 261, in <module>
'Topic :: Software Development',
File "C:\Users\Charles\AppData\Local\Programs\Python\Python37\lib\site-packages\setuptools\__init__.py", line 145, in setup
return distutils.core.setup(**attrs)
File "C:\Users\Charles\AppData\Local\Programs\Python\Python37\lib\distutils\core.py", line 148, in setup
dist.run_commands()
File "C:\Users\Charles\AppData\Local\Programs\Python\Python37\lib\distutils\dist.py", line 966, in run_commands
self.run_command(cmd)
File "C:\Users\Charles\AppData\Local\Programs\Python\Python37\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\Users\Charles\AppData\Local\Programs\Python\Python37\lib\site-packages\setuptools\command\install.py", line 61, in run
return orig.install.run(self)
File "C:\Users\Charles\AppData\Local\Programs\Python\Python37\lib\distutils\command\install.py", line 545, in run
self.run_command('build')
File "C:\Users\Charles\AppData\Local\Programs\Python\Python37\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "C:\Users\Charles\AppData\Local\Programs\Python\Python37\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\Users\Charles\AppData\Local\Programs\Python\Python37\lib\distutils\command\build.py", line 135, in run
self.run_command(cmd_name)
File "C:\Users\Charles\AppData\Local\Programs\Python\Python37\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "C:\Users\Charles\AppData\Local\Programs\Python\Python37\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\Users\Charles\AppData\Local\Temp\pip-req-build-k3302dt_\setup.py", line 135, in run
self.build_extension(ext)
File "C:\Users\Charles\AppData\Local\Temp\pip-req-build-k3302dt_\setup.py", line 172, in build_extension
subprocess.check_call(cmake_setup, cwd=build_folder)
File "C:\Users\Charles\AppData\Local\Programs\Python\Python37\lib\subprocess.py", line 347, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', 'C:\\Users\\Charles\\AppData\\Local\\Temp\\pip-req-build-k3302dt_\\tools\\python', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\\Users\\Charles\\AppData\\Local\\Temp\\pip-req-build-k3302dt_\\build\\lib.win-amd64-3.7', '-DPYTHON_EXECUTABLE=C:\\Users\\Charles\\AppData\\Local\\Programs\\Python\\Python37\\python.exe', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\\Users\\Charles\\AppData\\Local\\Temp\\pip-req-build-k3302dt_\\build\\lib.win-amd64-3.7', '-A', 'x64']' returned non-zero exit status 1.
----------------------------------------
ERROR: Command errored out with exit status 1: 'C:\Users\Charles\AppData\Local\Programs\Python\Python37\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Charles\\AppData\\Local\\Temp\\pip-req-build-k3302dt_\\setup.py'"'"'; __file__='"'"'C:\\Users\\Charles\\AppData\\Local\\Temp\\pip-req-build-k3302dt_\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\Charles\AppData\Local\Temp\pip-record-waso8gw6\install-record.txt' --single-version-externally-managed --compile --install-headers 'C:\Users\Charles\AppData\Local\Programs\Python\Python37\Include\dlib' Check the logs for full command output.
Im so lost, any response or suggestions will be appreciated so much. Thank you
You have figured it out yourself, but I wanted to add some remarks on your installation methods:
pip install dlib
As there is only the tar.gz on pypi, it downloads that and then tries to run setup.py after installing the reuqirements
Therefore, you manually doing the tar.gz, extracting it and running python setup.py install is the same thing as the first command and also
python -m pip install https://files.pythonhosted.org/packages/1e/62/aacb236d21fbd08148b1d517d58a9d80ea31bdcd386d26f21f8b23b1eb28/dlib-19.18.0.tar.gz
Is doing the same in the end, trying to run setup.py to install.
In this case it involves the compilation of c/c++ code which requires for the right compiler/build tools to be installed which pip cannot take care of. It is not built for this task.
Solved by installing VS with C++.
Please set your compiler path variable:
export CC=/usr/bin/gcc
and then do pip install dlib again. It should work. You might also want to check in usr/bin the right path to gcc.
Python 3.6 (64 bit) has to be already installed.
Run Windows Prompt Command.
You can type on the search bar “CMD”.
Remember to click with right button of the mouse and then “Run it as administrator”, otherwise you might not have the permission to install the library.
Type on the prompt command
python -m pip install https://files.pythonhosted.org/packages/0e/ce/f8a3cff33ac03a8219768f0694c5d703c8e037e6aba2e865f9bae22ed63c/dlib-19.8.1-cp36-cp36m-win_amd64.whl#sha256=794994fa2c54e7776659fddb148363a5556468a6d5d46be8dad311722d54bfcf
4. Once you see the message “Successfully installed dlib“, it means that the installation has been completed

error while using pip install dlib in pycharm in mac os

I m getting this error while using "pip install dlib" in pycharm in mac os. can anyone help me out
Collecting dlib
Using cached dlib-19.19.0.tar.gz (3.2 MB)
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: /Users/admin/Desktop/pythonwork/peoplecounter/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/8p/177ygjb93_9_y67f62dpyx8w0000gn/T/pycharm-packaging/dlib/setup.py'"'"'; __file__='"'"'/private/var/folders/8p/177ygjb93_9_y67f62dpyx8w0000gn/T/pycharm-packaging/dlib/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/8p/177ygjb93_9_y67f62dpyx8w0000gn/T/pip-record-f48gmks5/install-record.txt --single-version-externally-managed --compile --install-headers /Users/admin/Desktop/pythonwork/peoplecounter/include/site/python3.7/dlib
cwd: /private/var/folders/8p/177ygjb93_9_y67f62dpyx8w0000gn/T/pycharm-packaging/dlib/
Complete output (69 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
Building extension for Python 3.7.2 (default, Jan 13 2019, 12:50:01)
Invoking CMake setup: 'cmake /private/var/folders/8p/177ygjb93_9_y67f62dpyx8w0000gn/T/pycharm-packaging/dlib/tools/python -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/private/var/folders/8p/177ygjb93_9_y67f62dpyx8w0000gn/T/pycharm-packaging/dlib/build/lib.macosx-10.14-x86_64-3.7 -DPYTHON_EXECUTABLE=/Users/admin/Desktop/pythonwork/peoplecounter/bin/python -DCMAKE_BUILD_TYPE=Release'
-- The C compiler identification is unknown
-- The CXX compiler identification is unknown
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- broken
CMake Error at /usr/local/Cellar/cmake/3.16.2/share/cmake/Modules/CMakeTestCCompiler.cmake:60 (message):
The C compiler
"/usr/bin/cc"
is not able to compile a simple test program.
It fails with the following output:
Change Dir: /private/var/folders/8p/177ygjb93_9_y67f62dpyx8w0000gn/T/pycharm-packaging/dlib/build/temp.macosx-10.14-x86_64-3.7/CMakeFiles/CMakeTmp
Run Build Command(s):/usr/bin/make cmTC_35e30/fast && xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMakeLists.txt:3 (project)
-- Configuring incomplete, errors occurred!
See also "/private/var/folders/8p/177ygjb93_9_y67f62dpyx8w0000gn/T/pycharm-packaging/dlib/build/temp.macosx-10.14-x86_64-3.7/CMakeFiles/CMakeOutput.log".
See also "/private/var/folders/8p/177ygjb93_9_y67f62dpyx8w0000gn/T/pycharm-packaging/dlib/build/temp.macosx-10.14-x86_64-3.7/CMakeFiles/CMakeError.log".
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/private/var/folders/8p/177ygjb93_9_y67f62dpyx8w0000gn/T/pycharm-packaging/dlib/setup.py", line 261, in <module>
'Topic :: Software Development',
File "/Users/admin/Desktop/pythonwork/peoplecounter/lib/python3.7/site-packages/setuptools-39.1.0-py3.7.egg/setuptools/__init__.py", line 129, in setup
File "/usr/local/Cellar/python/3.7.2_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/distutils/core.py", line 148, in setup
dist.run_commands()
File "/usr/local/Cellar/python/3.7.2_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/distutils/dist.py", line 966, in run_commands
self.run_command(cmd)
File "/usr/local/Cellar/python/3.7.2_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/distutils/dist.py", line 985, in run_command
cmd_obj.run()
File "/Users/admin/Desktop/pythonwork/peoplecounter/lib/python3.7/site-packages/setuptools-39.1.0-py3.7.egg/setuptools/command/install.py", line 61, in run
File "/usr/local/Cellar/python/3.7.2_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/distutils/command/install.py", line 545, in run
self.run_command('build')
File "/usr/local/Cellar/python/3.7.2_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/usr/local/Cellar/python/3.7.2_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/distutils/dist.py", line 985, in run_command
cmd_obj.run()
File "/usr/local/Cellar/python/3.7.2_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/distutils/command/build.py", line 135, in run
self.run_command(cmd_name)
File "/usr/local/Cellar/python/3.7.2_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/usr/local/Cellar/python/3.7.2_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/distutils/dist.py", line 985, in run_command
cmd_obj.run()
File "/private/var/folders/8p/177ygjb93_9_y67f62dpyx8w0000gn/T/pycharm-packaging/dlib/setup.py", line 135, in run
self.build_extension(ext)
File "/private/var/folders/8p/177ygjb93_9_y67f62dpyx8w0000gn/T/pycharm-packaging/dlib/setup.py", line 172, in build_extension
subprocess.check_call(cmake_setup, cwd=build_folder)
File "/usr/local/Cellar/python/3.7.2_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/subprocess.py", line 347, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', '/private/var/folders/8p/177ygjb93_9_y67f62dpyx8w0000gn/T/pycharm-packaging/dlib/tools/python', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/private/var/folders/8p/177ygjb93_9_y67f62dpyx8w0000gn/T/pycharm-packaging/dlib/build/lib.macosx-10.14-x86_64-3.7', '-DPYTHON_EXECUTABLE=/Users/admin/Desktop/pythonwork/peoplecounter/bin/python', '-DCMAKE_BUILD_TYPE=Release']' returned non-zero exit status 1.
----------------------------------------
ERROR: Command errored out with exit status 1: /Users/admin/Desktop/pythonwork/peoplecounter/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/8p/177ygjb93_9_y67f62dpyx8w0000gn/T/pycharm-packaging/dlib/setup.py'"'"'; file='"'"'/private/var/folders/8p/177ygjb93_9_y67f62dpyx8w0000gn/T/pycharm-packaging/dlib/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record /private/var/folders/8p/177ygjb93_9_y67f62dpyx8w0000gn/T/pip-record-f48gmks5/install-record.txt --single-version-externally-managed --compile --install-headers /Users/admin/Desktop/pythonwork/peoplecounter/include/site/python3.7/dlib Check the logs for full command output.
I had the same issue in VSCode. After finding this issue I went to https://gist.github.com/gaquino/87bdf0e6e852e445c0489379d3e9732a
This reminded me that to upgrade to Catalina I had uninstalled XCode entirely and removed the Command Line tools to resolve some homebrew weirdness. I also migrated to zsh as that is Catalina's default. Not sure which of these requires a reinstall of XCode Command Line Tools, but I am sure one or several of them do.
Try installing the command line tools by opening a Terminal and typing:
$ xcode-select --install
And if this helps please credit me with closing this as it will De-StackOverflower me (be my first solved issue).
Thanks,
Daniel

Dlib installation error? [duplicate]

This question already has answers here:
dlib installation on Windows 10
(19 answers)
Closed 3 years ago.
Visual studio 2015 is not installed
I have installed all the requirements before building dlib in python:
Cmake
python 3.6 and other bindings.
while installing dlib using pip:
pip install dlib
Got an error:
Collecting dlib
Using cached https://files.pythonhosted.org/packages/df/aa/6a9bb2a763107bb2606d6ee1aa65fcd3b51375a9ef6436e9c9280b0dd63c/dlib-19.15.0.tar.gz
Building wheels for collected packages: dlib
Running setup.py bdist_wheel for dlib ... error
Complete output from command "c:\users\vikas tiwari\anaconda3\python.exe" -u -c "import setuptools, tokenize;__file__='C:\\Users\\VIKAST~1\\AppData\\Local\\Temp\\pip-install-4f4b8868\\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\VIKAST~1\AppData\Local\Temp\pip-wheel-nnayeybw --python-tag cp36:
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.6.5 |Anaconda, Inc.| (default, Mar 29 2018, 13:32:41) [MSC v.1900 64 bit (AMD64)]
Invoking CMake setup: 'cmake C:\Users\VIKAST~1\AppData\Local\Temp\pip-install-4f4b8868\dlib\tools\python -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\Users\VIKAST~1\AppData\Local\Temp\pip-install-4f4b8868\dlib\build\lib.win-amd64-3.6 -DPYTHON_EXECUTABLE=c:\users\vikas tiwari\anaconda3\python.exe -DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\Users\VIKAST~1\AppData\Local\Temp\pip-install-4f4b8868\dlib\build\lib.win-amd64-3.6 -A x64'
-- Building for: Visual Studio 14 2015
-- Selecting Windows SDK version to target Windows 10.0.17134.
CMake Error in CMakeLists.txt:
Failed to run MSBuild command:
C:/Program Files (x86)/MSBuild/14.0/bin/MSBuild.exe
to get the value of VCTargetsPath:
Microsoft (R) Build Engine version 14.0.25420.1
Copyright (C) Microsoft Corporation. All rights reserved.
Build started 8/7/2018 1:07:47 PM.
Project "C:\Users\Vikas Tiwari\AppData\Local\Temp\pip-install-4f4b8868\dlib\build\temp.win-amd64-3.6\Release\CMakeFiles\3.12.0\VCTargetsPath.vcxproj" on node 1 (default targets).
C:\Users\Vikas Tiwari\AppData\Local\Temp\pip-install-4f4b8868\dlib\build\temp.win-amd64-3.6\Release\CMakeFiles\3.12.0\VCTargetsPath.vcxproj(14,2): error MSB4019: The imported project "C:\Microsoft.Cpp.Default.props" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.
Done Building Project "C:\Users\Vikas Tiwari\AppData\Local\Temp\pip-install-4f4b8868\dlib\build\temp.win-amd64-3.6\Release\CMakeFiles\3.12.0\VCTargetsPath.vcxproj" (default targets) -- FAILED.
Build FAILED.
"C:\Users\Vikas Tiwari\AppData\Local\Temp\pip-install-4f4b8868\dlib\build\temp.win-amd64-3.6\Release\CMakeFiles\3.12.0\VCTargetsPath.vcxproj" (default target) (1) ->
C:\Users\Vikas Tiwari\AppData\Local\Temp\pip-install-4f4b8868\dlib\build\temp.win-amd64-3.6\Release\CMakeFiles\3.12.0\VCTargetsPath.vcxproj(14,2): error MSB4019: The imported project "C:\Microsoft.Cpp.Default.props" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.
0 Warning(s)
1 Error(s)
Time Elapsed 00:00:00.03
Exit code: 1
-- Configuring incomplete, errors occurred!
See also "C:/Users/Vikas Tiwari/AppData/Local/Temp/pip-install-4f4b8868/dlib/build/temp.win-amd64-3.6/Release/CMakeFiles/CMakeOutput.log".
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\VIKAST~1\AppData\Local\Temp\pip-install-4f4b8868\dlib\setup.py", line 257, in <module>
'Topic :: Software Development',
File "c:\users\vikas tiwari\anaconda3\lib\site-packages\setuptools\__init__.py", line 129, in setup
return distutils.core.setup(**attrs)
File "c:\users\vikas tiwari\anaconda3\lib\distutils\core.py", line 148, in setup
dist.run_commands()
File "c:\users\vikas tiwari\anaconda3\lib\distutils\dist.py", line 955, in run_commands
self.run_command(cmd)
File "c:\users\vikas tiwari\anaconda3\lib\distutils\dist.py", line 974, in run_command
cmd_obj.run()
File "c:\users\vikas tiwari\anaconda3\lib\site-packages\wheel\bdist_wheel.py", line 202, in run
self.run_command('build')
File "c:\users\vikas tiwari\anaconda3\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "c:\users\vikas tiwari\anaconda3\lib\distutils\dist.py", line 974, in run_command
cmd_obj.run()
File "c:\users\vikas tiwari\anaconda3\lib\distutils\command\build.py", line 135, in run
self.run_command(cmd_name)
File "c:\users\vikas tiwari\anaconda3\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "c:\users\vikas tiwari\anaconda3\lib\distutils\dist.py", line 974, in run_command
cmd_obj.run()
File "C:\Users\VIKAST~1\AppData\Local\Temp\pip-install-4f4b8868\dlib\setup.py", line 133, in run
self.build_extension(ext)
File "C:\Users\VIKAST~1\AppData\Local\Temp\pip-install-4f4b8868\dlib\setup.py", line 170, in build_extension
subprocess.check_call(cmake_setup, cwd=build_folder)
File "c:\users\vikas tiwari\anaconda3\lib\subprocess.py", line 291, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', 'C:\\Users\\VIKAST~1\\AppData\\Local\\Temp\\pip-install-4f4b8868\\dlib\\tools\\python', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\\Users\\VIKAST~1\\AppData\\Local\\Temp\\pip-install-4f4b8868\\dlib\\build\\lib.win-amd64-3.6', '-DPYTHON_EXECUTABLE=c:\\users\\vikas tiwari\\anaconda3\\python.exe', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\\Users\\VIKAST~1\\AppData\\Local\\Temp\\pip-install-4f4b8868\\dlib\\build\\lib.win-amd64-3.6', '-A', 'x64']' returned non-zero exit status 1.
----------------------------------------
Failed building wheel for dlib
Running setup.py clean for dlib
Failed to build dlib
Installing collected packages: dlib
Running setup.py install for dlib ... error
Complete output from command "c:\users\vikas tiwari\anaconda3\python.exe" -u -c "import setuptools, tokenize;__file__='C:\\Users\\VIKAST~1\\AppData\\Local\\Temp\\pip-install-4f4b8868\\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\VIKAST~1\AppData\Local\Temp\pip-record-aol24hcc\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.6.5 |Anaconda, Inc.| (default, Mar 29 2018, 13:32:41) [MSC v.1900 64 bit (AMD64)]
Invoking CMake setup: 'cmake C:\Users\VIKAST~1\AppData\Local\Temp\pip-install-4f4b8868\dlib\tools\python -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\Users\VIKAST~1\AppData\Local\Temp\pip-install-4f4b8868\dlib\build\lib.win-amd64-3.6 -DPYTHON_EXECUTABLE=c:\users\vikas tiwari\anaconda3\python.exe -DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\Users\VIKAST~1\AppData\Local\Temp\pip-install-4f4b8868\dlib\build\lib.win-amd64-3.6 -A x64'
-- Building for: Visual Studio 14 2015
-- Selecting Windows SDK version to target Windows 10.0.17134.
CMake Error in CMakeLists.txt:
Failed to run MSBuild command:
C:/Program Files (x86)/MSBuild/14.0/bin/MSBuild.exe
to get the value of VCTargetsPath:
Microsoft (R) Build Engine version 14.0.25420.1
Copyright (C) Microsoft Corporation. All rights reserved.
Build started 8/7/2018 1:07:50 PM.
Project "C:\Users\Vikas Tiwari\AppData\Local\Temp\pip-install-4f4b8868\dlib\build\temp.win-amd64-3.6\Release\CMakeFiles\3.12.0\VCTargetsPath.vcxproj" on node 1 (default targets).
C:\Users\Vikas Tiwari\AppData\Local\Temp\pip-install-4f4b8868\dlib\build\temp.win-amd64-3.6\Release\CMakeFiles\3.12.0\VCTargetsPath.vcxproj(14,2): error MSB4019: The imported project "C:\Microsoft.Cpp.Default.props" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.
Done Building Project "C:\Users\Vikas Tiwari\AppData\Local\Temp\pip-install-4f4b8868\dlib\build\temp.win-amd64-3.6\Release\CMakeFiles\3.12.0\VCTargetsPath.vcxproj" (default targets) -- FAILED.
Build FAILED.
"C:\Users\Vikas Tiwari\AppData\Local\Temp\pip-install-4f4b8868\dlib\build\temp.win-amd64-3.6\Release\CMakeFiles\3.12.0\VCTargetsPath.vcxproj" (default target) (1) ->
C:\Users\Vikas Tiwari\AppData\Local\Temp\pip-install-4f4b8868\dlib\build\temp.win-amd64-3.6\Release\CMakeFiles\3.12.0\VCTargetsPath.vcxproj(14,2): error MSB4019: The imported project "C:\Microsoft.Cpp.Default.props" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.
0 Warning(s)
1 Error(s)
Time Elapsed 00:00:00.03
Exit code: 1
-- Configuring incomplete, errors occurred!
See also "C:/Users/Vikas Tiwari/AppData/Local/Temp/pip-install-4f4b8868/dlib/build/temp.win-amd64-3.6/Release/CMakeFiles/CMakeOutput.log".
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\VIKAST~1\AppData\Local\Temp\pip-install-4f4b8868\dlib\setup.py", line 257, in <module>
'Topic :: Software Development',
File "c:\users\vikas tiwari\anaconda3\lib\site-packages\setuptools\__init__.py", line 129, in setup
return distutils.core.setup(**attrs)
File "c:\users\vikas tiwari\anaconda3\lib\distutils\core.py", line 148, in setup
dist.run_commands()
File "c:\users\vikas tiwari\anaconda3\lib\distutils\dist.py", line 955, in run_commands
self.run_command(cmd)
File "c:\users\vikas tiwari\anaconda3\lib\distutils\dist.py", line 974, in run_command
cmd_obj.run()
File "c:\users\vikas tiwari\anaconda3\lib\site-packages\setuptools\command\install.py", line 61, in run
return orig.install.run(self)
File "c:\users\vikas tiwari\anaconda3\lib\distutils\command\install.py", line 545, in run
self.run_command('build')
File "c:\users\vikas tiwari\anaconda3\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "c:\users\vikas tiwari\anaconda3\lib\distutils\dist.py", line 974, in run_command
cmd_obj.run()
File "c:\users\vikas tiwari\anaconda3\lib\distutils\command\build.py", line 135, in run
self.run_command(cmd_name)
File "c:\users\vikas tiwari\anaconda3\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "c:\users\vikas tiwari\anaconda3\lib\distutils\dist.py", line 974, in run_command
cmd_obj.run()
File "C:\Users\VIKAST~1\AppData\Local\Temp\pip-install-4f4b8868\dlib\setup.py", line 133, in run
self.build_extension(ext)
File "C:\Users\VIKAST~1\AppData\Local\Temp\pip-install-4f4b8868\dlib\setup.py", line 170, in build_extension
subprocess.check_call(cmake_setup, cwd=build_folder)
File "c:\users\vikas tiwari\anaconda3\lib\subprocess.py", line 291, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', 'C:\\Users\\VIKAST~1\\AppData\\Local\\Temp\\pip-install-4f4b8868\\dlib\\tools\\python', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\\Users\\VIKAST~1\\AppData\\Local\\Temp\\pip-install-4f4b8868\\dlib\\build\\lib.win-amd64-3.6', '-DPYTHON_EXECUTABLE=c:\\users\\vikas tiwari\\anaconda3\\python.exe', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\\Users\\VIKAST~1\\AppData\\Local\\Temp\\pip-install-4f4b8868\\dlib\\build\\lib.win-amd64-3.6', '-A', 'x64']' returned non-zero exit status 1.
----------------------------------------
Command ""c:\users\vikas tiwari\anaconda3\python.exe" -u -c "import setuptools, tokenize;__file__='C:\\Users\\VIKAST~1\\AppData\\Local\\Temp\\pip-install-4f4b8868\\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\VIKAST~1\AppData\Local\Temp\pip-record-aol24hcc\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\VIKAST~1\AppData\Local\Temp\pip-install-4f4b8868\dlib\
I really don't have any idea what's the real issue here. Do i have to install Visual Studio to compile c++ files of dlib ?
Don't have VS 2015 installed right now!!
Here is how I solved the same issue.
Make sure you have installed cmake and CMAKE_FOLDER\bin added it in environment varaible
Install anaconda
then run following commands in anaconda shell.
conda update conda
conda update anaconda
create new environment conda create -n env_dlib python=3.6
activate enviroment conda activate env_dlib
install dlib conda install -c conda-forge dlib
Verify your installation in python shell using
import dlib
dlib.__version__
Forget Everything and try the method to install dlib and/or opencv here from scratch.
It's a very simple 3 step method
Install anaconda
Activate virtual enviroment using cmd
Install dlib and opencv using pip through cmd.
You can connect to this thread as well.
Here you go :
Download CMake from cmake and add it to PATH(C:\Program Files\CMake\bin)
Install dlib using pip(pip install dlib==19.4)

Error installing dlib in windows 10

I can't seem to install dlib on my windows 10 machine using pip.
I am using python 3.6.1
i did try pip installing dlib using the following commands
pip install dlib
but it returns me with the following error.
Collecting dlib
Using cached dlib-19.10.0.tar.gz
Installing collected packages: dlib
Running setup.py install for dlib ... error
Complete output from command c:\users\ayush\appdata\local\programs\python \python36-32\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\Ayush\\AppData\\Local\\Temp\\pip-build-iu6_cvvs\\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\Ayush\AppData\Local\Temp\pip-uhnfkgpd-record\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
Invoking CMake setup: 'cmake C:\Users\Ayush\AppData\Local\Temp\pip-build-iu6_cvvs\dlib\tools\python -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\Users\Ayush\AppData\Local\Temp\pip-build-iu6_cvvs\dlib\build\lib.win32-3.6 -DPYTHON_EXECUTABLE=c:\users\ayush\appdata\local\programs\python\python36-32\python.exe -DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\Users\Ayush\AppData\Local\Temp\pip-build-iu6_cvvs\dlib\build\lib.win32-3.6'
-- Building for: NMake Makefiles
-- The C compiler identification is unknown
-- The CXX compiler identification is unknown
CMake Error in CMakeLists.txt:
The CMAKE_C_COMPILER:
cl
is not a full path and was not found in the PATH.
To use the NMake generator with Visual C++, cmake must be run from a shell
that can use the compiler cl from the command line. This environment is
unable to invoke the cl compiler. To fix this problem, run cmake from the
Visual Studio Command Prompt (vcvarsall.bat).
Tell CMake where to find the compiler by setting either the environment
variable "CC" or the CMake cache entry CMAKE_C_COMPILER to the full path to
the compiler, or to the compiler name if it is in the PATH.
CMake Error in CMakeLists.txt:
The CMAKE_CXX_COMPILER:
cl
is not a full path and was not found in the PATH.
To use the NMake generator with Visual C++, cmake must be run from a shell
that can use the compiler cl from the command line. This environment is
unable to invoke the cl compiler. To fix this problem, run cmake from the
Visual Studio Command Prompt (vcvarsall.bat).
Tell CMake where to find the compiler by setting either the environment
variable "CXX" or the CMake cache entry CMAKE_CXX_COMPILER to the full path
to the compiler, or to the compiler name if it is in the PATH.
-- Configuring incomplete, errors occurred!
See also "C:/Users/Ayush/AppData/Local/Temp/pip-build-iu6_cvvs/dlib/build/temp.win32-3.6/Release/CMakeFiles/CMakeOutput.log".
See also "C:/Users/Ayush/AppData/Local/Temp/pip-build-iu6_cvvs/dlib/build/temp.win32-3.6/Release/CMakeFiles/CMakeError.log".
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\Ayush\AppData\Local\Temp\pip-build-iu6_cvvs\dlib\setup.py", line 249, in <module>
'Topic :: Software Development',
File "c:\users\ayush\appdata\local\programs\python\python36-32\lib\distutils\core.py", line 148, in setup
dist.run_commands()
File "c:\users\ayush\appdata\local\programs\python\python36-32\lib\distutils\dist.py", line 955, in run_commands
self.run_command(cmd)
File "c:\users\ayush\appdata\local\programs\python\python36-32\lib\distutils\dist.py", line 974, in run_command
cmd_obj.run()
File "c:\users\ayush\appdata\local\programs\python\python36-32\lib\site-packages\setuptools\command\install.py", line 61, in run
return orig.install.run(self)
File "c:\users\ayush\appdata\local\programs\python\python36-32\lib\distutils\command\install.py", line 545, in run
self.run_command('build')
File "c:\users\ayush\appdata\local\programs\python\python36-32\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "c:\users\ayush\appdata\local\programs\python\python36-32\lib\distutils\dist.py", line 974, in run_command
cmd_obj.run()
File "c:\users\ayush\appdata\local\programs\python\python36-32\lib\distutils\command\build.py", line 135, in run
self.run_command(cmd_name)
File "c:\users\ayush\appdata\local\programs\python\python36-32\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "c:\users\ayush\appdata\local\programs\python\python36-32\lib\distutils\dist.py", line 974, in run_command
cmd_obj.run()
File "C:\Users\Ayush\AppData\Local\Temp\pip-build-iu6_cvvs\dlib\setup.py", line 129, in run
self.build_extension(ext)
File "C:\Users\Ayush\AppData\Local\Temp\pip-build-iu6_cvvs\dlib\setup.py", line 163, in build_extension
subprocess.check_call(cmake_setup, cwd=build_folder)
File "c:\users\ayush\appdata\local\programs\python\python36-32\lib\subprocess.py", line 291, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', 'C:\\Users\\Ayush\\AppData\\Local\\Temp\\pip-build-iu6_cvvs\\dlib\\tools\\python', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\\Users\\Ayush\\AppData\\Local\\Temp\\pip-build-iu6_cvvs\\dlib\\build\\lib.win32-3.6', '-DPYTHON_EXECUTABLE=c:\\users\\ayush\\appdata\\local\\programs\\python\\python36-32\\python.exe', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\\Users\\Ayush\\AppData\\Local\\Temp\\pip-build-iu6_cvvs\\dlib\\build\\lib.win32-3.6']' returned non-zero exit status 1.
i have Cmake installed and i also tried setting a environmental variable path to the Cmake library but the same error occurs.

How do I install PIL/Pillow for Python 3.6?

I have a script that requires PIL to run. Other than downgrading my Python, I couldn't find anyway to install PIL on my Python 3.6
Here are my attempts:
pip install pil
Collecting pil
Could not find a version that satisfies the requirement pil (from versions: )
No matching distribution found for pil
pip install Pillow
Collecting Pillow
Using cached Pillow-3.3.1.zip
Installing collected packages: Pillow
Running setup.py install for Pillow ... error
Complete output from command c:\python\python36\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\ABDULR~1\\AppData\\Local\\Temp\\pip-build-rez5zpri\\Pillow\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record C:\Users\ABDULR~1\AppData\Local\Temp\pip-a5bugnjo-record\install-record.txt --single-version-externally-managed --compile:
Single threaded build for windows
running install
running build
running build_py
creating build
creating build\lib.win-amd64-3.6
creating build\lib.win-amd64-3.6\PIL
copying PIL\......................
..................................
..................................
running egg_info
writing Pillow.egg-info\PKG-INFO
writing dependency_links to Pillow.egg-info\dependency_links.txt
writing top-level names to Pillow.egg-info\top_level.txt
warning: manifest_maker: standard file '-c' not found
reading manifest file 'Pillow.egg-info\SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no files found matching '*.sh'
no previously-included directories found matching 'docs\_static'
warning: no previously-included files found matching '.coveragerc'
warning: no previously-included files found matching '.editorconfig'
warning: no previously-included files found matching '.landscape.yaml'
warning: no previously-included files found matching 'appveyor.yml'
warning: no previously-included files found matching 'build_children.sh'
warning: no previously-included files found matching 'tox.ini'
warning: no previously-included files matching '.git*' found anywhere in distribution
warning: no previously-included files matching '*.pyc' found anywhere in distribution
warning: no previously-included files matching '*.so' found anywhere in distribution
writing manifest file 'Pillow.egg-info\SOURCES.txt'
copying PIL\OleFileIO-README.md -> build\lib.win-amd64-3.6\PIL
running build_ext
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\ABDULR~1\AppData\Local\Temp\pip-build-rez5zpri\Pillow\setup.py", line 753, in <module>
zip_safe=not debug_build(), )
File "c:\python\python36\lib\distutils\core.py", line 148, in setup
dist.run_commands()
File "c:\python\python36\lib\distutils\dist.py", line 955, in run_commands
self.run_command(cmd)
File "c:\python\python36\lib\distutils\dist.py", line 974, in run_command
cmd_obj.run()
File "c:\python\python36\lib\site-packages\setuptools\command\install.py", line 61, in run
return orig.install.run(self)
File "c:\python\python36\lib\distutils\command\install.py", line 539, in run
self.run_command('build')
File "c:\python\python36\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "c:\python\python36\lib\distutils\dist.py", line 974, in run_command
cmd_obj.run()
File "c:\python\python36\lib\distutils\command\build.py", line 135, in run
self.run_command(cmd_name)
File "c:\python\python36\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "c:\python\python36\lib\distutils\dist.py", line 974, in run_command
cmd_obj.run()
File "c:\python\python36\lib\distutils\command\build_ext.py", line 338, in run
self.build_extensions()
File "C:\Users\ABDULR~1\AppData\Local\Temp\pip-build-rez5zpri\Pillow\setup.py", line 521, in build_extensions
' using --disable-%s, aborting' % (f, f))
ValueError: zlib is required unless explicitly disabled using --disable-zlib, aborting
----------------------------------------
Command "c:\python\python36\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\ABDULR~1\\AppData\\Local\\Temp\\pip-build-rez5zpri\\Pillow\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record C:\Users\ABDULR~1\AppData\Local\Temp\pip-a5bugnjo-record\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\ABDULR~1\AppData\Local\Temp\pip-build-rez5zpri\Pillow\
Didn't know to add argument --disable-zlib, pip install Pillow --disable-zlib wasn't correct.
Couldn't find what matches my system here: https://pypi.python.org/pypi/Pillow/3.0.0
64-bit Windows 10 & Python 3.6
For python version 2.x you can simply use
pip install pillow
But for python version 3.X you need to specify
(sudo) pip3 install pillow
when you enter pip in bash hit tab and you will see what options you have
You can download the wheel corresponding to your configuration here ("Pillow‑4.1.1‑cp36‑cp36m‑win_amd64.whl" in your case) and install it with:
pip install some-package.whl
If you have problem to install the wheel read this answer
Pillow is released with installation wheels on Windows:
We provide Pillow binaries for Windows
compiled for the matrix of supported Pythons
in both 32 and 64-bit versions in wheel, egg,
and executable installers. These binaries have
all of the optional libraries included
https://pillow.readthedocs.io/en/3.3.x/installation.html#basic-installation
Update: Python 3.6 is now supported by Pillow. Install with pip install pillow and check https://pillow.readthedocs.io/en/latest/installation.html for more information.
However, Python 3.6 is still in alpha and not officially supported yet, although the tests do all pass for the nightly Python builds (currently 3.6a4).
https://travis-ci.org/python-pillow/Pillow/jobs/155605577
If it's somehow possible to install the 3.5 wheel for 3.6, that's your best bet. Otherwise, zlib notwithstanding, you'll need to build from source, requiring an MS Visual C++ compiler, and which isn't straightforward. For tips see:
https://pillow.readthedocs.io/en/3.3.x/installation.html#building-from-source
And also see how it's built for Windows on AppVeyor CI (but not yet 3.5 or 3.6):
https://github.com/python-pillow/Pillow/tree/master/winbuild
Failing that, downgrade to Python 3.5 or wait until 3.6 is supported by Pillow, probably closer to the 3.6's official release.
In Windows 10 for those struggling to install PIL/pillow while coding on PyCharm and have Python 3.10.6 proceed as follows;
Close PyCharm IDE Open and Run CMD.exe prompt as Administrator
In CMD prompt, run pip3 install pillow
After pillow is installed, close CMD prompt
Open PyCharm IDE and you will see that you can now import PIL

Resources