使用Windows 10

时间:2017-09-09 23:59:36

标签: python visual-studio cmake dlib

编辑:看起来我必须安装Visual Studio 2015 ...我可以在没有VS 2015的情况下安装dlib吗?我已经预装了Windows的旧版本。

我正在使用Python 3.5,尝试在终端上的PyCharm上安装dlib,这就是我所得到的,每次搜索这些错误我都会...我在Visual Studio上找到的东西,我不知道有GUI +我没有任何Visual Studio版本(8,11,12,14)的VC文件夹中的vcvarsall.bat。 我在网上发布此问题之前搜索了很多金额。 我是否需要下载Visual Studio最新版本才能获得vcvarsall.bat?

这是CMakeLists.txt:

cmake_minimum_required(VERSION ${CMAKE_VERSION})
project(IntelFortranImplicit Fortran)
add_custom_command(
  OUTPUT output.cmake
  COMMAND ${CMAKE_COMMAND} -P ${IntelFortranImplicit_SOURCE_DIR}/detect.cmake
  )
add_library(FortranLib hello.f output.cmake)

这是我的错误:pip install dlib

  Collecting dlib
      Using cached dlib-19.6.1.tar.gz
    Building wheels for collected packages: dlib
      Running setup.py bdist_wheel for dlib ... error
      Complete output from command C:\Users\tiger\Anaconda3\envs\TensorFlowExample\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\tiger\\AppDat
    a\\Local\\Temp\\pip-build-gjtgkl6a\\dlib\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code
    , __file__, 'exec'))" bdist_wheel -d C:\Users\tiger\AppData\Local\Temp\tmprc21rnv_pip-wheel- --python-tag cp35:
      running bdist_wheel
      running build
      error: Cannot find cmake, ensure it is installed and in the path.
      You can install cmake using the instructions at https://cmake.org/install/
      You can also specify its path with --cmake parameter.

      ----------------------------------------
      Failed building wheel for dlib
      Running setup.py clean for dlib
    Failed to build dlib
    Installing collected packages: dlib
      Running setup.py install for dlib ... error
        Complete output from command C:\Users\tiger\Anaconda3\envs\TensorFlowExample\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\tiger\\AppD
    ata\\Local\\Temp\\pip-build-gjtgkl6a\\dlib\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(co
    de, __file__, 'exec'))" install --record C:\Users\tiger\AppData\Local\Temp\pip-dk1naa28-record\install-record.txt --single-version-externally-managed --compile
    :
        running install
        running build
        error: Cannot find cmake, ensure it is installed and in the path.
        You can install cmake using the instructions at https://cmake.org/install/
        You can also specify its path with --cmake parameter.

        ----------------------------------------
    Command "C:\Users\tiger\Anaconda3\envs\TensorFlowExample\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\tiger\\AppData\\Local\\Temp\\pip-bu
    ild-gjtgkl6a\\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\tiger\AppData\Local\Temp\pip-dk1naa28-record\install-record.txt --single-version-externally-managed --compile" failed with error code
     1 in C:\Users\tiger\AppData\Local\Temp\pip-build-gjtgkl6a\dlib\

2 个答案:

答案 0 :(得分:1)

此处找到解决方案: Using Anaconda installing manager..! 在PyCharm终端中运行以下代码:conda install -c conda-forge dlib=19.4 我能够使用dlib! :)

非常感谢birryree在评论中让我知道!

答案 1 :(得分:0)

  1. 以管理模式打开Anaconda提示。
  2. conda更新conda3。conda更新anaconda
  3. conda create -n dlib_env python = 3.7
  4. conda激活dlib_env
  5. conda install -c conda-forge dlib
  6. python 7.1 >>>导入dlib 7.2 >>> dlib。版本

Source