gpt4 book ai didi

python - CMake在Python Virtualenv中安装DLib时找不到C和C++编译器

转载 作者:行者123 更新时间:2023-12-02 10:53:03 30 4
gpt4 key购买 nike

看完有关使用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指向它呢?

最佳答案

该链接帮助:

docs.microsoft.com/zh-CN/cpp/build/vscpp-step-0-installation

我遵循了使用Visual Studio安装C++编译器的过程,本文已对此进行了详细介绍。之后,我运行python setup.py install,一切正常。

感谢斯塔克!

关于python - CMake在Python Virtualenv中安装DLib时找不到C和C++编译器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60798167/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com