How to fix error while installing dlib on python 3.7.3 64 bit windows 10

一世执手 提交于 2020-05-15 21:19:31

问题


I'm trying to install dlib on Windows 10 using anaconda prompt. Using pip install dlib But I'm getting this error

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!

I have already installed cmake using pip install cmake and it was successfully downloaded.


回答1:


By default, your cmake seems to be using a different generator than is supported for your platform. In your cmd, type cmake --help. This will print a list of generators to choose from, mine looks something like this:

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".

Make sure that you also have the Visual Studio 15 ... line. Then you should be able to run your installation:

  1. Grab the source code, e.g. v19.17
  2. Unzip, and open a cmd in the unzipped source folder
  3. run python setup.py -G Visual Studio 15 2017 Win64

This should tell cmake to use the correct visual studio generator.

Also worth mentioning, since you seem to be using anaconda, is the fact that dlib should be available from the conda-forge and can be installed like thie:

conda install -c conda-forge dlib 



回答2:


I successfully installed dlib 19.8.1 on Python 3.7 for windows 64bit using https://www.file-upload.com/qsd69ajuqr2i



来源:https://stackoverflow.com/questions/57588118/how-to-fix-error-while-installing-dlib-on-python-3-7-3-64-bit-windows-10

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!