简体   繁体   中英

Cant install dlib in pycharm

when I install dlib this error occurs. I have Microsoft visual c++ 15 installed and I use python 3.7

how to solve this problem

ERROR: Command errored out with exit status 1:

command: 'c:\users\arun\appdata\local\programs\python\python37\python.exe' -u -c 'import

sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\Arun\AppData\Local\Temp\pip-ins

tall-lmmcwnu_\dlib_2eee917da90a4678b1df02cb4f909e4b\setup.py'"'"'; file ='"'"'C:\Users\

\Arun\AppData\Local\Temp\pip-install-lmmcwnu_\dlib_2eee917da90a4678b1df02cb4f909e4b\set

up.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)( file );code=f.read().replace('"'"'\r\

n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file , '"'"'exec'"'"'))' install --reco

rd 'C:\Users\Arun\AppData\Local\Temp\pip-record-prlmpx1h\install-record.txt' --single-version

-externally-managed --compile --install-headers 'c:\users\arun\appdata\local\programs\python\

python37\Include\dlib'

cwd: C:\Users\Arun\AppData\Local\Temp\pip-install-lmmcwnu_\dlib_2eee917da90a4678b1df

02cb4f909e4b\

Complete output (57 lines):

running install

running build

running build_py

package init file 'tools\python\dlib_ init _.py' not found (or not a regular file)

running build_ext

Building extension for Python 3.7.7 (tags/v3.7.7:d7c567b08f, Mar 10 2020, 10:41:24) [MSC

v.1900 64 bit (AMD64)]

Invoking CMake setup: 'cmake C:\Users\Arun\AppData\Local\Temp\pip-install-lmmcwnu_\dlib_2

eee917da90a4678b1df02cb4f909e4b\tools\python -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\Users\Arun\A

ppData\Local\Temp\pip-install-lmmcwnu_\dlib_2eee917da90a4678b1df02cb4f909e4b\build\lib.win-am

d64-3.7 -DPYTHON_EXECUTABLE=c:\users\arun\appdata\local\programs\python\python37\python.exe -

DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\Users\Arun\AppData\Local\Temp\pip-install-lmmcwnu_

\dlib_2eee917da90a4678b1df02cb4f909e4b\build\lib.win-amd64-3.7 -A x64'

-- Building for: Visual Studio 16 2019

-- Selecting Windows SDK version to target Windows 6.3.9600.

-- 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/Arun/AppData/Local/Temp/pip-install-lmmcwnu_/dlib_2eee917da90a4678b1df

02cb4f909e4b/build/temp.win-amd64-3.7/Release/CMakeFiles/CMakeOutput.log".

See also "C:/Users/Arun/AppData/Local/Temp/pip-install-lmmcwnu_/dlib_2eee917da90a4678b1df

02cb4f909e4b/build/temp.win-amd64-3.7/Release/CMakeFiles/CMakeError.log".

Traceback (most recent call last):

File "", line 1, in

File "C:\Users\Arun\AppData\Local\Temp\pip-install-lmmcwnu_\dlib_2eee917da90a4678b1df02

cb4f909e4b\setup.py", line 262, in

'Topic:: Software Development',

File "c:\users\arun\appdata\local\programs\python\python37\lib\site-packages\setuptools

_ init _.py", line 145, in setup

return distutils.core.setup(**attrs)

File "c:\users\arun\appdata\local\programs\python\python37\lib\distutils\core.py", line

148, in setup

dist.run_commands()

File "c:\users\arun\appdata\local\programs\python\python37\lib\distutils\dist.py", line

966, in run_commands

self.run_command(cmd)

File "c:\users\arun\appdata\local\programs\python\python37\lib\distutils\dist.py", line 985, in run_command cmd_obj.run()

File "c:\users\arun\appdata\local\programs\python\python37\lib\site-packages\setuptools\command\install.py", line 61, in run return orig.install.run(self)

File "c:\users\arun\appdata\local\programs\python\python37\lib\distutils\command\install.py", line 545, in run

self.run_command('build')

File "c:\users\arun\appdata\local\programs\python\python37\lib\distutils\cmd.py", line 313, in run_command

self.distribution.run_command(command)

File "c:\users\arun\appdata\local\programs\python\python37\lib\distutils\dist.py", line 985, in run_command cmd_obj.run()

File "c:\users\arun\appdata\local\programs\python\python37\lib\distutils\command\build.py", line 135, in run self.run_command(cmd_name)

File "c:\users\arun\appdata\local\programs\python\python37\lib\distutils\cmd.py", line 313, in run_command self.distribution.run_command(command)

File "c:\users\arun\appdata\local\programs\python\python37\lib\distutils\dist.py", line 985, in run_command

cmd_obj.run()

File "C:\Users\Arun\AppData\Local\Temp\pip-install-lmmcwnu_\dlib_2eee917da90a4678b1df02cb4f909e4b\setup.py", line 135, in run self.build_extension(ext)

File "C:\Users\Arun\AppData\Local\Temp\pip-install-lmmcwnu_\dlib_2eee917da90a4678b1df02cb4f909e4b\setup.py", line 172, in build_extension

subprocess.check_call(cmake_setup, cwd=build_folder)

File "c:\users\arun\appdata\local\programs\python\python37\lib\subprocess.py", line 363, in check_call raise CalledProcessError(retcode, cmd)

subprocess.CalledProcessError: Command '['cmake', 'C:\Users\Arun\AppData\Local\Temp\pip-install-lmmcwnu_\dlib_2eee917da90a4678b1df02cb4f909e4b\tools\python', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\Users\Arun\AppData\Local\Temp\pip-install-lmmcwnu_\dlib_2eee917da90a4678b1df02cb4f909e4b\build\lib.win-amd64-3.7', '-DPYTHON_EXECUTABLE=c:\users\arun\appdata\local\programs\python\python37\python.exe', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\Users\Arun\AppData\Local\Temp\pip-install-lmmcwnu_\dlib_2eee917da90a4678b1df02c

b4f909e4b\build\lib.win-amd64-3.7', '-A', 'x64']' returned non-zero exit status 1.


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

The issue is that you're missing a usable compiler toolchain. First get Cmake and set that up, then give it another shot.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM