Yet Another DLIB installation problem despite CMake installed - python

I have CMake tool installed using Visual STudio Build tools 2019. I have rechecked my ENV variables multiple times.
I have tried installation using the Source. I have followed this and all the other discussions as well.
Here is the detailed error
running install
C:\Users\asus\PycharmProjects\drowsiness-detection\envt\lib\site-packages\setuptools\command\install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
warnings.warn(
C:\Users\asus\PycharmProjects\drowsiness-detection\envt\lib\site-packages\setuptools\command\easy_install.py:160: EasyInstallDeprecationWarning: easy_install command is deprecated. Use build and pip and other standards-based tools.
warnings.warn(
running bdist_egg
running egg_info
writing tools/python\dlib.egg-info\PKG-INFO
writing dependency_links to tools/python\dlib.egg-info\dependency_links.txt
writing top-level names to tools/python\dlib.egg-info\top_level.txt
package init file 'tools\python\dlib\__init__.py' not found (or not a regular file)
reading manifest file 'tools/python\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\cmake_utils\*\build*'
no previously-included directories found matching 'dlib\test'
warning: no previously-included files matching '*.pyc' found anywhere in distribution
writing manifest file 'tools/python\dlib.egg-info\SOURCES.txt'
installing library code to build\bdist.win-amd64\egg
running install_lib
running build_py
running build_ext
C:\Users\asus\Downloads\dlib-19.23.0\dlib-19.23.0\setup.py:129: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
if LooseVersion(cmake_version) < '3.1.0':
Building extension for Python 3.10.2 (tags/v3.10.2:a58ebcc, Jan 17 2022, 14:12:15) [MSC v.1929 64 bit (AMD64)]
Invoking CMake setup: 'cmake C:\Users\asus\Downloads\dlib-19.23.0\dlib-19.23.0\tools\python -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\Users\asus\Downloads\dlib-19.23.0\dlib-19.23.0\build\lib
.win-amd64-3.10 -DPYTHON_EXECUTABLE=C:\Users\asus\PycharmProjects\drowsiness-detection\envt\Scripts\python.exe -DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\Users\asus\Downloads\dlib-19.23.0\dlib-19.23.0\build\lib.win-amd64-3.10 -A x64'
-- Selecting Windows SDK version 10.0.17763.0 to target Windows 10.0.22000.
CMake Error at CMakeLists.txt:14 (project):
Failed to run MSBuild command:
C:/Program Files (x86)/Microsoft Visual Studio/2019/BuildTools/MSBuild/Current/Bin/MSBuild.exe
to get the value of VCTargetsPath:
Microsoft (R) Build Engine version 16.11.2+f32259642 for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.
Build started 27-Feb-22 6:58:45 PM.
Project "C:\Users\asus\Downloads\dlib-19.23.0\dlib-19.23.0\build\temp.win-amd64-3.10\Release\CMakeFiles\3.18.4\VCTargetsPath.vcxproj" on node 1 (default targets).
C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Microsoft\VC\v160\Microsoft.Cpp.WindowsSDK.targets(46,5): error MSB8036: The Windows SDK version 10.0.17763.0
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\asus\Downloads\dlib-19.23.0\dlib-19.23.0\build\temp.win-amd64-3.10\Release\CMakeFiles\3.18.4\VCTargetsPath.vcxproj]
Done Building Project "C:\Users\asus\Downloads\dlib-19.23.0\dlib-19.23.0\build\temp.win-amd64-3.10\Release\CMakeFiles\3.18.4\VCTargetsPath.vcxproj" (default targets) -- FAILED.
Build FAILED.
"C:\Users\asus\Downloads\dlib-19.23.0\dlib-19.23.0\build\temp.win-amd64-3.10\Release\CMakeFiles\3.18.4\VCTargetsPath.vcxproj" (default target) (1) ->
(_CheckWindowsSDKInstalled target) ->
C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Microsoft\VC\v160\Microsoft.Cpp.WindowsSDK.targets(46,5): error MSB8036: The Windows SDK version 10.0.17763
.0 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\asus\Downloads\dlib-19.23.0\dlib-19.23.0\build\temp.win-amd64-3.10\Release\CMakeFiles\3.18.4\VCTargetsPath.vcxproj]
0 Warning(s)
1 Error(s)
Time Elapsed 00:00:00.21
Exit code: 1
-- Configuring incomplete, errors occurred!
See also "C:/Users/asus/Downloads/dlib-19.23.0/dlib-19.23.0/build/temp.win-amd64-3.10/Release/CMakeFiles/CMakeOutput.log".
Traceback (most recent call last):
File "C:\Users\asus\Downloads\dlib-19.23.0\dlib-19.23.0\setup.py", line 222, in <module>
setup(
File "C:\Users\asus\PycharmProjects\drowsiness-detection\envt\lib\site-packages\setuptools\__init__.py", line 155, in setup
return distutils.core.setup(**attrs)
File "C:\Users\asus\PycharmProjects\drowsiness-detection\envt\lib\site-packages\setuptools\_distutils\core.py", line 148, in setup
return run_commands(dist)
File "C:\Users\asus\PycharmProjects\drowsiness-detection\envt\lib\site-packages\setuptools\_distutils\core.py", line 163, in run_commands
dist.run_commands()
File "C:\Users\asus\PycharmProjects\drowsiness-detection\envt\lib\site-packages\setuptools\_distutils\dist.py", line 967, in run_commands
self.run_command(cmd)
File "C:\Users\asus\PycharmProjects\drowsiness-detection\envt\lib\site-packages\setuptools\_distutils\dist.py", line 986, in run_command
cmd_obj.run()
File "C:\Users\asus\PycharmProjects\drowsiness-detection\envt\lib\site-packages\setuptools\command\install.py", line 74, in run
self.do_egg_install()
File "C:\Users\asus\PycharmProjects\drowsiness-detection\envt\lib\site-packages\setuptools\command\install.py", line 116, in do_egg_install
self.run_command('bdist_egg')
File "C:\Users\asus\PycharmProjects\drowsiness-detection\envt\lib\site-packages\setuptools\_distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
self.build_extension(ext)
File "C:\Users\asus\Downloads\dlib-19.23.0\dlib-19.23.0\setup.py", line 171, in build_extension
subprocess.check_call(cmake_setup, cwd=build_folder)
File "C:\Users\asus\AppData\Local\Programs\Python\Python310\lib\subprocess.py", line 369, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', 'C:\\Users\\asus\\Downloads\\dlib-19.23.0\\dlib-19.23.0\\tools\\python', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\\Users\\asus\\Downloads\\dlib-19.23.0\\dlib-19.23.0\\build\\lib.win-amd64-3.10', '-DPYTHON_EXECUTABLE=C:\\Users\\asus\\PycharmProjects\\drowsiness-detection\\envt\\Scripts\\python.exe', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\\Users\\asus\\Downloads\\dlib-19.23.0\\dlib-19.23.0\\build\\lib.win-amd64-3.10', '-A', 'x64']' returned non-zero exit status 1.
I am not using Anacodna and I am on Windows 10 platform. Any help is much appreciated.

Do you have Windows SDK version 10.0.17763.0 installed? It should look something like this screenshot:

Related

Unable to install autodock vina (potentially due to boost)

As part of a script I am writing, I need to install the package autodock vina for the purpose of ligand and protein binding. Every time I attempt to "pip install vina", I recieve an error message " ValueError: Boost library location was not found!". Upon attempting to install boost manually, I have been unable to run the bootstrap file, as it does not make the b2 folder that online tutorials say it will make.
To resolve this issue, I installed conda, and made an active environment with every single prerequisite, including boost, installed. I have checked for the version of all of these prerequisites and confirmed their existence, as well as double and triple-checking that I am in the write active environment. Upon installation, I either get the same issue (using conda install vina) or when using "conda install -c bioconda autodock-vina", I get a message saying that the package does not exist (despite adding cforge and bioconda as active package handlers, and the existence of said package is clearly documented online). Does anyone have any suggestions? I've been attempting to install this piece of software for 3 days and I've completely exhausted the documentation, as well as all other similar question answers, with nothing working.
Full error message:
Collecting vina
Using cached vina-1.2.3.tar.gz (95 kB)
Installing build dependencies ... done
Getting requirements to build wheel ... error
error: subprocess-exited-with-error
× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> [56 lines of output]
Version found 1.2.3 (from __init__.py)
running egg_info
creating vina.egg-info
writing vina.egg-info\PKG-INFO
writing dependency_links to vina.egg-info\dependency_links.txt
writing requirements to vina.egg-info\requires.txt
writing top-level names to vina.egg-info\top_level.txt
writing manifest file 'vina.egg-info\SOURCES.txt'
Boost library is not installed in this conda environment.
Traceback (most recent call last):
File "C:\Users\chris\AppData\Local\Programs\Python\Python310\lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py", line 363, in <module>
main()
File "C:\Users\chris\AppData\Local\Programs\Python\Python310\lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py", line 345, in main
json_out['return_val'] = hook(**hook_input['kwargs'])
File "C:\Users\chris\AppData\Local\Programs\Python\Python310\lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py", line 130, in get_requires_for_build_wheel
return hook(config_settings)
File "C:\Users\chris\AppData\Local\Temp\pip-build-env-r7vbpka4\overlay\Lib\site-packages\setuptools\build_meta.py", line 177, in get_requires_for_build_wheel
return self._get_build_requires(
File "C:\Users\chris\AppData\Local\Temp\pip-build-env-r7vbpka4\overlay\Lib\site-packages\setuptools\build_meta.py", line 159, in _get_build_requires
self.run_setup()
File "C:\Users\chris\AppData\Local\Temp\pip-build-env-r7vbpka4\overlay\Lib\site-packages\setuptools\build_meta.py", line 174, in run_setup
exec(compile(code, __file__, 'exec'), locals())
File "setup.py", line 346, in <module>
setup(
File "C:\Users\chris\AppData\Local\Temp\pip-build-env-r7vbpka4\overlay\Lib\site-packages\setuptools\__init__.py", line 87, in setup
return distutils.core.setup(**attrs)
File "C:\Users\chris\AppData\Local\Temp\pip-build-env-r7vbpka4\overlay\Lib\site-packages\setuptools\_distutils\core.py", line 148, in setup
return run_commands(dist)
File "C:\Users\chris\AppData\Local\Temp\pip-build-env-r7vbpka4\overlay\Lib\site-packages\setuptools\_distutils\core.py", line 163, in run_commands
dist.run_commands()
File "C:\Users\chris\AppData\Local\Temp\pip-build-env-r7vbpka4\overlay\Lib\site-packages\setuptools\_distutils\dist.py", line 967, in run_commands
self.run_command(cmd)
File "C:\Users\chris\AppData\Local\Temp\pip-build-env-r7vbpka4\overlay\Lib\site-packages\setuptools\dist.py", line 1214, in run_command
super().run_command(command)
File "C:\Users\chris\AppData\Local\Temp\pip-build-env-r7vbpka4\overlay\Lib\site-packages\setuptools\_distutils\dist.py", line 986, in run_command
cmd_obj.run()
File "C:\Users\chris\AppData\Local\Temp\pip-build-env-r7vbpka4\overlay\Lib\site-packages\setuptools\command\egg_info.py", line 308, in run
self.find_sources()
File "C:\Users\chris\AppData\Local\Temp\pip-build-env-r7vbpka4\overlay\Lib\site-packages\setuptools\command\egg_info.py", line 315, in find_sources
mm.run()
File "C:\Users\chris\AppData\Local\Temp\pip-build-env-r7vbpka4\overlay\Lib\site-packages\setuptools\command\egg_info.py", line 550, in run
self.add_defaults()
File "C:\Users\chris\AppData\Local\Temp\pip-build-env-r7vbpka4\overlay\Lib\site-packages\setuptools\command\egg_info.py", line 587, in add_defaults
sdist.add_defaults(self)
File "C:\Users\chris\AppData\Local\Temp\pip-build-env-r7vbpka4\overlay\Lib\site-packages\setuptools\_distutils\command\sdist.py", line 228, in add_defaults
self._add_defaults_ext()
File "C:\Users\chris\AppData\Local\Temp\pip-build-env-r7vbpka4\overlay\Lib\site-packages\setuptools\_distutils\command\sdist.py", line 311, in _add_defaults_ext
build_ext = self.get_finalized_command('build_ext')
File "C:\Users\chris\AppData\Local\Temp\pip-build-env-r7vbpka4\overlay\Lib\site-packages\setuptools\_distutils\cmd.py", line 299, in get_finalized_command
cmd_obj.ensure_finalized()
File "C:\Users\chris\AppData\Local\Temp\pip-build-env-r7vbpka4\overlay\Lib\site-packages\setuptools\_distutils\cmd.py", line 107, in ensure_finalized
self.finalize_options()
File "setup.py", line 247, in finalize_options
raise ValueError(error_msg)
ValueError: Boost library location was not found!
Directories searched: conda env, /usr/local/include and /usr/include.
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error
× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> See above for output.
note: This error originates from a subprocess, and is likely not a problem with pip.
I also get this error. I asked ResearchGate how to solve this problem and Cheng Shen adviced to use WSL/WSL2 to simulate a Linux environment and then run conda install -c bioconda vina (or another command like this)
What I did.
Install WSL and Ubuntu on Windows 2. Run code . in WSL terminal (for installing VS Code [recommended])
Install Anaconda/Miniconda following this guide
Type conda install -c bioconda vina in Ubuntu terminal (bioconda channel will download all required packages - boost, swig, etc.)
Vina should be successfully installed ( vina --version in WSL Terminal to check)
I found it much easier to install packages for docking via WSL and use VS Code to run scripts there. It's VERY easier than trying to solve this problem by configuring boost for Windows. If you have any questions you can ask me in ResearchGate.

Cannot install face_recognition using pip install face_recognition on Win10

I get the error
Running setup.py install for dlib ... error
error: subprocess-exited-with-error
× Running setup.py install for dlib did not run successfully.
│ exit code: 1
╰─> [58 lines of output]
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.10.4 (tags/v3.10.4:9d38120, Mar 23 2022, 23:13:41) [MSC v.1929 64 bit (AMD64)]
Invoking CMake setup: 'cmake C:\Users\amade\AppData\Local\Temp\pip-install-_k5e982w\dlib_237006073dfd4b13993bf60b7ecb3629\tools\python -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\Users\amade\AppData\Local\Temp\pip-install-_k5e982w\dlib_237006073dfd4b13993bf60b7ecb3629\build\lib.win-amd64-3.10 -DPYTHON_EXECUTABLE=C:\Users\amade\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\python.exe -DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\Users\amade\AppData\Local\Temp\pip-install-_k5e982w\dlib_237006073dfd4b13993bf60b7ecb3629\build\lib.win-amd64-3.10 -A x64'
-- Building for: Visual Studio 17 2022
-- Selecting Windows SDK version to target Windows 10.0.19044.
-- The C compiler identification is unknown
-- The CXX compiler identification is unknown
CMake Error at CMakeLists.txt:14 (project):
No CMAKE_C_COMPILER could be found.
CMake Error at CMakeLists.txt:14 (project):
No CMAKE_CXX_COMPILER could be found.
-- Configuring incomplete, errors occurred!
See also "C:/Users/amade/AppData/Local/Temp/pip-install-_k5e982w/dlib_237006073dfd4b13993bf60b7ecb3629/build/temp.win-amd64-3.10/Release/CMakeFiles/CMakeOutput.log".
See also "C:/Users/amade/AppData/Local/Temp/pip-install-_k5e982w/dlib_237006073dfd4b13993bf60b7ecb3629/build/temp.win-amd64-3.10/Release/CMakeFiles/CMakeError.log".
Traceback (most recent call last):
File "<string>", line 2, in <module>
File "<pip-setuptools-caller>", line 34, in <module>
File "C:\Users\amade\AppData\Local\Temp\pip-install-_k5e982w\dlib_237006073dfd4b13993bf60b7ecb3629\setup.py", line 222, in <module>
setup(
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.1264.0_x64__qbz5n2kfra8p0\lib\site-packages\setuptools\__init__.py", line 153, in setup
return distutils.core.setup(**attrs)
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.1264.0_x64__qbz5n2kfra8p0\lib\distutils\core.py", line 148, in setup
dist.run_commands()
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.1264.0_x64__qbz5n2kfra8p0\lib\distutils\dist.py", line 966, in run_commands
self.run_command(cmd)
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.1264.0_x64__qbz5n2kfra8p0\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.1264.0_x64__qbz5n2kfra8p0\lib\site-packages\setuptools\command\install.py", line 61, in run
return orig.install.run(self)
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.1264.0_x64__qbz5n2kfra8p0\lib\distutils\command\install.py", line 568, in run
self.run_command('build')
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.1264.0_x64__qbz5n2kfra8p0\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.1264.0_x64__qbz5n2kfra8p0\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.1264.0_x64__qbz5n2kfra8p0\lib\distutils\command\build.py", line 135, in run
self.run_command(cmd_name)
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.1264.0_x64__qbz5n2kfra8p0\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.1264.0_x64__qbz5n2kfra8p0\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\Users\amade\AppData\Local\Temp\pip-install-_k5e982w\dlib_237006073dfd4b13993bf60b7ecb3629\setup.py", line 134, in run
self.build_extension(ext)
File "C:\Users\amade\AppData\Local\Temp\pip-install-_k5e982w\dlib_237006073dfd4b13993bf60b7ecb3629\setup.py", line 171, in build_extension
subprocess.check_call(cmake_setup, cwd=build_folder)
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.1264.0_x64__qbz5n2kfra8p0\lib\subprocess.py", line 369, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', 'C:\\Users\\amade\\AppData\\Local\\Temp\\pip-install-_k5e982w\\dlib_237006073dfd4b13993bf60b7ecb3629\\tools\\python', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\\Users\\amade\\AppData\\Local\\Temp\\pip-install-_k5e982w\\dlib_237006073dfd4b13993bf60b7ecb3629\\build\\lib.win-amd64-3.10', '-DPYTHON_EXECUTABLE=C:\\Users\\amade\\AppData\\Local\\Microsoft\\WindowsApps\\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\\python.exe', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\\Users\\amade\\AppData\\Local\\Temp\\pip-install-_k5e982w\\dlib_237006073dfd4b13993bf60b7ecb3629\\build\\lib.win-amd64-3.10', '-A', 'x64']' returned non-zero exit status 1.
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure
× Encountered error while trying to install package.
╰─> dlib
note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.
Follow the steps below to install face_recognition python package on Windows 10.
The instruction has been tested on Windows 10 64bit, python 3.9.
Step 1
Download CMake installation package for your OS from official site
Step 2
Install downloaded CMake installation package. Please make sure that Add CMake to system PATH option has been selected during the installation.
Step 3
Reboot your OS (restart computer)
Step 4
Run pip install dlib
It tooks several minutes so be prepared to wait
Step 5
If it completes without any errors, you're all set. Run pip install face_recognition to install face_recognition.
Result
Fixed it. I had to modify my Visual Studio install from Start menu programs, and include latest MSVC and include Windows 10 SDK under Individual Components

How to solve issue related to installation of dlib on Windows 10?

I am trying to install dlib for face-recognition for python 3.7 on windows 10, I explored few ways but I am getting errors.I tried below steps-
Installed cmake using 'pip install cmake'. This worked.
Downloaed the Dlib source(.tar.gz) from the Python Package Index : https://pypi.org/project/dlib/#files extract it and enter into the folder.
Ran the installation: python setup.py install
I am getting below error.
*
*C:\Program Files\dlib-19.18.0>python setup.py install
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.3 (default, Apr 24 2019, 15:29:51) [MSC v.1915 64 bit (AMD64)]
Invoking CMake setup: 'cmake C:\Program Files\dlib-19.18.0\tools\python -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\Program Files\dlib-19.18.0\build\lib.win-amd64-3.7 -DPYTHON_EXECUTABLE=C:\Users\Sriparna\Anaconda3\python.exe -DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\Program Files\dlib-19.18.0\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:/Program Files/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\Sriparna\Anaconda3\lib\site-packages\setuptools\__init__.py", line 145, in setup
return distutils.core.setup(**attrs)
File "C:\Users\Sriparna\Anaconda3\lib\distutils\core.py", line 148, in setup
dist.run_commands()
File "C:\Users\Sriparna\Anaconda3\lib\distutils\dist.py", line 966, in run_commands
self.run_command(cmd)
File "C:\Users\Sriparna\Anaconda3\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\Users\Sriparna\Anaconda3\lib\site-packages\setuptools\command\install.py", line 67, in run
self.do_egg_install()
File "C:\Users\Sriparna\Anaconda3\lib\site-packages\setuptools\command\install.py", line 109, in do_egg_install
self.run_command('bdist_egg')
File "C:\Users\Sriparna\Anaconda3\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "C:\Users\Sriparna\Anaconda3\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\Users\Sriparna\Anaconda3\lib\site-packages\setuptools\command\bdist_egg.py", line 172, in run
cmd = self.call_command('install_lib', warn_dir=0)
File "C:\Users\Sriparna\Anaconda3\lib\site-packages\setuptools\command\bdist_egg.py", line 158, in call_command
self.run_command(cmdname)
File "C:\Users\Sriparna\Anaconda3\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "C:\Users\Sriparna\Anaconda3\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\Users\Sriparna\Anaconda3\lib\site-packages\setuptools\command\install_lib.py", line 11, in run
self.build()
File "C:\Users\Sriparna\Anaconda3\lib\distutils\command\install_lib.py", line 107, in build
self.run_command('build_ext')
File "C:\Users\Sriparna\Anaconda3\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "C:\Users\Sriparna\Anaconda3\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\Sriparna\Anaconda3\lib\subprocess.py", line 347, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', 'C:\\Program Files\\dlib-19.18.0\\tools\\python', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\\Program Files\\dlib-19.18.0\\build\\lib.win-amd64-3.7', '-DPYTHON_EXECUTABLE=C:\\Users\\Sriparna\\Anaconda3\\python.exe', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\\Program Files\\dlib-19.18.0\\build\\lib.win-amd64-3.7', '-A', 'x64']' returned non-zero exit status 1.*
*
Can you please advise how to solve this issue?
In my system i'd done using Anaconda. The Dlib library supports python 3.6 to 3.7.0 in conda environments.
follow the instruction to install face recognition model,
install Anaconda from https://www.anaconda.com/distribution/#download-section
in conda prompt, create an environment using this command
conda create --name env_name python=3.7.0
then activate the env
conda activate env_name
install dlib
conda install -c conda-forge dlib=19.17
now install face_recogintion models using pip
pip install face_recogntion
Installing face_recognition on Windows 10
Requirements:
Microsoft Visual Studio 2015 (or newer) with C/C++ Compiler installed.
Microsoft Visual C++ (MSVC) 14.0 installed (need to install the visual c++ build tools)
CMake for windows and add it to your system environment variables
Boost installed and added to system environment variables
Python 3 with the same system type as your OS (ie. 64-bit, 32-bit)
Installing MSVC 14.0 and Cmake for windows
Download Microsoft C++ build tools from https://visualstudio.microsoft.com/visual-cpp-build-tools/ and
install
Once the installation finished, click on modify in the Visual Studio Build Tools 2019 (2) section
Go to the Individual components tab, under the Compilers, build tools, and runtimes, tick on C++ CMake tools for Windows and MSVC v140
VS 2015 C++ build tools (v14.00) and click modify. The Visual Studio Installer will begin to download and install MSVC 14.0 and Cmake for
you
Adding MSVC 14.0 and Cmake to System Variables
On the search tab, type This PC and right-click, choose properties
Go to the Advanced system settings, under Advanced tab click on Environment Variables
Under System variables, click New… and fill the following: Name: VS140COMNTOOLS Value: C:\Program Files (x86)\Microsoft Visual Studio
14.0\Common7\Tools\
Click OK
Under User variables, click on variable named Path and click Edit…
Click New and fill “C:\Program Files\CMake\bin”
Click OK, click OK again
Installing Boost and face_recognition
Download Boost library source code or binary release for your current MSVC from https://sourceforge.net/projects/boost/files/
Extract the Boost source files into C:\local\boost_1_XX_X (X means the current version of Boost you have). You may need to create local
directory
Open Developer Command Prompt for Visual Studio and go to the current directory of Boost extracted and try these commands to compile
Boost: bootstrap b2 -a --with-python address-model=64
toolset=msvc runtime-link=static
If you successfully compile Boost, it should create compiled files in stage directory
Go to Command prompt and type $ pip install face_recognition

Install Django on machine without internet access

I have VM with Win7. Python is running in Version 2.7. Now I want to install Django. I download django as tar.gz from official website. Then I move the file to VM and try to install with...
C:\Users\TestUser>pip install D:\Django-1.10.5.tar.gz
But it not work. I get this output:
Processing d:\django-1.10.5.tar.gz
Building wheels for collected packages: Django
Running setup.py bdist_wheel for Django
Stored in directory: C:\Users\TestUser\AppData\Local\pip\Cache\wheels\78\62\f
a\c970671f67ec027f6445dc8ed9a3155e774c0e75ca63dd291b
Successfully built Django
Installing collected packages: Django
Exception:
Traceback (most recent call last):
File "D:\TestUser\Programm\Python27\lib\site-packages\pip\basecommand.py", lin
e 223, in main
status = self.run(options, args)
File "D:\TestUser\Programm\Python27\lib\site-packages\pip\commands\install.py"
, line 298, in run
root=options.root_path,
File "D:\TestUser\Programm\Python27\lib\site-packages\pip\req\req_set.py", lin
e 622, in install
**kwargs
File "D:\TestUser\Programm\Python27\lib\site-packages\pip\req\req_install.py",
line 808, in install
self.move_wheel_files(self.source_dir, root=root)
File "D:\TestUser\Programm\Python27\lib\site-packages\pip\req\req_install.py",
line 1003, in move_wheel_files
isolated=self.isolated,
File "D:\TestUser\Programm\Python27\lib\site-packages\pip\wheel.py", line 339,
in move_wheel_files
clobber(source, lib_dir, True)
File "D:\TestUser\Programm\Python27\lib\site-packages\pip\wheel.py", line 323,
in clobber
os.utime(destfile, (st.st_atime, st.st_mtime))
WindowsError: [Error 87] Falscher Parameter: 'D:\\TestUser\\Programm\\Python27\\
Lib\\site-packages\\django\\shortcuts.py'
Also the following comand not work:
D:\dist\Django-1.10.5>python setup.py install
running install
running bdist_egg
running egg_info
writing requirements to Django.egg-info\requires.txt
writing Django.egg-info\PKG-INFO
writing top-level names to Django.egg-info\top_level.txt
writing dependency_links to Django.egg-info\dependency_links.txt
writing entry points to Django.egg-info\entry_points.txt
reading manifest file 'Django.egg-info\SOURCES.txt'
reading manifest template 'MANIFEST.in'
no previously-included directories found matching 'django\contrib\admin\bin'
warning: no previously-included files matching '__pycache__' found anywhere in
istribution
writing manifest file 'Django.egg-info\SOURCES.txt'
installing library code to build\bdist.win32\egg
running install_lib
running build_py
creating build
creating build\lib
creating build\lib\django
copying django\shortcuts.py -> build\lib\django
error: [Error 87] Falscher Parameter: 'build\\lib\\django\\shortcuts.py'
What's wrong? Thanks.
Eric

Set up cassandra driver (python) in Docker

I used a docker file several months ago that (1) uses base ubuntu image, (2) installs miniconda python distribution, (3) installs some python libraries using miniconda, (4) runs following commands to set up cassandra-driver for python.
RUN pip install --upgrade pip
RUN pip install cassandra-driver
This worked perfectly six months ago. But now I'm getting this exception.
Step 13 : RUN pip install cassandra-driver
---> Running in ba9955650d7c
Collecting cassandra-driver
Downloading cassandra-driver-3.0.0.tar.gz (186kB)
Complete output from command python setup.py egg_info:
warning: no files found matching '*.pyx' under directory 'Cython/Debugger/Tests'
warning: no files found matching '*.pxd' under directory 'Cython/Debugger/Tests'
warning: no files found matching '*.h' under directory 'Cython/Debugger/Tests'
warning: no files found matching '*.pxd' under directory 'Cython/Utility'
unable to execute 'gcc': No such file or directory
Unable to find pgen, not compiling formal grammar.
Traceback (most recent call last):
File "<string>", line 20, in <module>
File "/tmp/pip-build-0XzsPv/cassandra-driver/setup.py", line 375, in <module>
run_setup(None)
File "/tmp/pip-build-0XzsPv/cassandra-driver/setup.py", line 373, in run_setup
**kw)
File "/miniconda/lib/python2.7/distutils/core.py", line 111, in setup
_setup_distribution = dist = klass(attrs)
File "/miniconda/lib/python2.7/site-packages/setuptools-19.1.1-py2.7.egg/setuptools/dist.py", line 268, in __init__
File "/miniconda/lib/python2.7/site-packages/setuptools-19.1.1-py2.7.egg/setuptools/dist.py", line 312, in fetch_build_eggs
File "/miniconda/lib/python2.7/site-packages/setuptools-19.1.1-py2.7.egg/pkg_resources/__init__.py", line 846, in resolve
File "/miniconda/lib/python2.7/site-packages/setuptools-19.1.1-py2.7.egg/pkg_resources/__init__.py", line 1091, in best_match
File "/miniconda/lib/python2.7/site-packages/setuptools-19.1.1-py2.7.egg/pkg_resources/__init__.py", line 1103, in obtain
File "/miniconda/lib/python2.7/site-packages/setuptools-19.1.1-py2.7.egg/setuptools/dist.py", line 379, in fetch_build_egg
File "/miniconda/lib/python2.7/site-packages/setuptools-19.1.1-py2.7.egg/setuptools/command/easy_install.py", line 639, in easy_install
File "/miniconda/lib/python2.7/site-packages/setuptools-19.1.1-py2.7.egg/setuptools/command/easy_install.py", line 669, in install_item
File "/miniconda/lib/python2.7/site-packages/setuptools-19.1.1-py2.7.egg/setuptools/command/easy_install.py", line 852, in install_eggs
File "/miniconda/lib/python2.7/site-packages/setuptools-19.1.1-py2.7.egg/setuptools/command/easy_install.py", line 1080, in build_and_install
File "/miniconda/lib/python2.7/site-packages/setuptools-19.1.1-py2.7.egg/setuptools/command/easy_install.py", line 1068, in run_setup
distutils.errors.DistutilsError: Setup script exited with error: command 'gcc' failed with exit status 1
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-0XzsPv/cassandra-driver
The command '/bin/sh -c pip install cassandra-driver' returned a non-zero code: 1
What might be going wrong? Is the installation package broken or I'm not doing it right?
The python cassandra-driver now uses Cython extensions by default since version 2.7.0, but there is an escape hatch for those who don't have easy access to the cython distribution or don't need it which might be a good option for you as well. The cython extensions do offer a boon to performance, but it might not be suitable for a lot of cases (especially where you are not doing high throughput).
From the install documentation:
By default, this package uses Cython to optimize core modules and build custom extensions. This is not a hard requirement, but is engaged by default to build extensions offering better performance than the pure Python implementation.
This build phase can be avoided using the build switch, or an environment variable:
python setup.py install --no-cython
-or-
pip install --install-option="--no-cython" <spec-or-path>
Alternatively, an environment variable can be used to switch this option regardless of context:
CASS_DRIVER_NO_CYTHON=1 <your script here>
In order to install cassandra-driver you need to compile some C source files however you don't have gcc inside your container:
unable to execute 'gcc': No such file or directory
Try to install gcc and python-dev packages before installing cassandra-driver:
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
python-dev \
gcc \
&& rm -rf /var/lib/apt/lists/*

Categories