我正在尝试使用anaconda提示符在Windows 10上安装dlib。使用pip install dlib 但是我遇到了这个错误
Failed building wheel for dlib
Running setup.py clean for dlib
Failed to build dlib
CMake Error in CMakeLists.txt:
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!
我已经使用pip install cmake安装了cmake,并且已成功下载。
答案 0 :(得分:0)
默认情况下,您的cmake
使用的发电机似乎与平台所支持的发电机不同。在您的cmd
中,键入cmake --help
。这将打印出发电机列表,供我选择,
The following generators are available on this platform:
Visual Studio 15 2017 [arch] = Generates Visual Studio 2017 project files.
Optional [arch] can be "Win64" or "ARM".
Visual Studio 14 2015 [arch] = Generates Visual Studio 2015 project files.
Optional [arch] can be "Win64" or "ARM".
Visual Studio 12 2013 [arch] = Generates Visual Studio 2013 project files.
Optional [arch] can be "Win64" or "ARM".
Visual Studio 11 2012 [arch] = Generates Visual Studio 2012 project files.
Optional [arch] can be "Win64" or "ARM".
Visual Studio 10 2010 [arch] = Generates Visual Studio 2010 project files.
Optional [arch] can be "Win64" or "IA64".
Visual Studio 9 2008 [arch] = Generates Visual Studio 2008 project files.
Optional [arch] can be "Win64" or "IA64".
确保您也有Visual Studio 15 ...
行。然后,您应该能够运行安装:
cmd
python setup.py -G Visual Studio 15 2017 Win64
这应该告诉cmake
使用正确的Visual Studio生成器。
值得一提的是,由于您似乎正在使用anaconda,因此dlib
应该可以从conda-forge
获得,并且可以像thie一样安装:
conda install -c conda-forge dlib