【问题标题】:CMake cannot find a C and C++ compiler while installing DLib in a Python Virtualenv在 Python Virtualenv 中安装 DLib 时,CMake 找不到 C 和 C++ 编译器
【发布时间】:2020-03-22 10:24:31
【问题描述】:

在观看了有关 Python 面部识别的教程后,我设法在我的 Linux 笔记本电脑上编写了一个工作程序。今天我试图在我的 Windows 10 PC 上做同样的事情,但是在尝试从源代码安装 DLib 时,我一直收到错误:

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.win32\egg
running install_lib
running build_py
running build_ext
Building extension for Python 3.8.0 (tags/v3.8.0:fa919fd, Oct 14 2019, 19:21:23) [MSC v.1916 32 bit (Intel)]
Invoking CMake setup: 'cmake D:\Pyton_Pliki\facial_recognition\Lib\site-packages\tools\python -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=D:\Pyton_Pliki\facial_recognition\Lib\site-packages\build\lib.win32-3.8 -DPYTHON_EXECUTABLE=C:\Users\kubus\AppData\Local\Programs\Python\Python38-32\python.exe -DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=D:\Pyton_Pliki\facial_recognition\Lib\site-packages\build\lib.win32-3.8'
-- Building for: Visual Studio 16 2019
-- Selecting Windows SDK version  to target Windows 10.0.18362.
-- The C compiler identification is unknown
-- The CXX compiler identification is unknown
CMake Error at CMakeLists.txt:3 (project):
  No CMAKE_C_COMPILER could be found.

我安装了 VS 16 2019,并使用 Windows 安装程序和 VS 工具安装了 CMake。 我知道问题出在编译器上,但是如何安装一个并将 CMake 指向它?

【问题讨论】:

标签: python c++ cmake compiler-errors


【解决方案1】:

此链接有帮助:

docs.microsoft.com/en-us/cpp/build/vscpp-step-0-installation

我按照本文详细介绍的使用 Visual Studio 安装 C++ 编译器的过程进行操作。之后我运行python setup.py install,一切正常。

感谢斯塔克!

【讨论】:

  • @squareskittles 我编辑了我的答案,以便提供更多信息。希望现在没事!
猜你喜欢
  • 1970-01-01
  • 2016-06-08
  • 2018-05-18
  • 2015-10-15
  • 2013-11-17
  • 2012-09-28
  • 2018-12-11
  • 1970-01-01
相关资源
最近更新 更多