繁体   English   中英

使用 Windows 10 在 Python 3.5 上安装 dlib 时出错

[英]Error when installing dlib on Python 3.5 using Windows 10

编辑:看起来我必须安装 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\

在这里找到的解决方案: 使用 Anaconda 安装管理器..! 在 PyCharm 终端中运行以下命令: conda install -c conda-forge dlib=19.4我能够使用 dlib! :)

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

  1. 在管理模式下打开 Anaconda Prompt。
  2. conda 更新 conda 3. conda 更新 anaconda
  3. 畅达创建 -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。 版本

来源

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM