在Windows 10

时间:2018-04-10 09:02:19

标签: python-3.x cmake pip dlib

我似乎无法使用pip在我的Windows 10机器上安装dlib。 我正在使用python 3.6.1 我尝试使用以下命令pip安装dlib

pip install dlib 

但它返回我的错误。

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.

我安装了Cmake,我也尝试设置一个环境变量路径到Cmake库,但同样的错误发生。

0 个答案:

没有答案