【问题标题】:Dlib installing error: Could NOT find BoostDlib 安装错误:找不到 Boost
【发布时间】:2017-10-01 15:57:31
【问题描述】:

(请原谅我的英语不好!)尝试在我的计算机(Windows 10 Pro,64x)上安装 dlib 库时陷入陷阱,但始终出现相同的错误:找不到 Boost

我已经做了什么:

  1. 已安装 Visual Studio Community 2017 版本 15.1
  2. 已安装 Anaconda:Python 3.6.0 |Anaconda 4.3.1(64 位)| (默认,2016 年 12 月 23 日,11:57:41)[MSC v.1900 64 位 (AMD64)] 在 win32 上
  3. 下载 boost_1_64_0.7z 并解压
  4. 跑引导
  5. b2 -a --with-python address-model=64 toolset=msvc runtime-link=static

收到消息:The Boost C++ Libraries were successfully built!

6.下一步:

    set BOOST_LIBRARYDIR=C:\Users\Lelek\boost_1_64_0\stage\lib
    set BOOST_INCLUDEDIR=C:\Users\Lelek\boost_1_64_0
    set BOOST_ROOT=C:\Users\Lelek\boost_1_64_0
    set PATH=%PATH%;%BOOST_ROOT%;%BOOST_LIBRARYDIR%

7。在这个阶段,如果我尝试从 dlib 目录中调用 run python setup.py install,我会得到输出(尝试调用 cmake -G "Visual Studio 15 2017 Win64" -DPYTHON3=1 .\tools\python 时会出现相同的错误):

    CMake Warning at C:/Program Files/Cmake/share/cmake-3.8/Modules/FindBoost.cmake:1521 (message):
    No header defined for python-py34; skipping header check
    Call Stack (most recent call first):
    C:/Users/Lelek/dlib-19.4/dlib/cmake_utils/add_python_module:61(FIND_PACKAGE)
    CMakeLists.txt:6 (include)
    -- Could NOT find Boost
    CMake Warning at C:/Program Files/Cmake/share/cmake-3.8/Modules/FindBoost.cmake:1521 (message):
    No header defined for python-py35; skipping header check
    Call Stack (most recent call first):
    C:/Users/Lelek/dlib-19.4/dlib/cmake_utils/add_python_module:63 (FIND_PACKAGE)
    CMakeLists.txt:6 (include)
    -- Could NOT find Boost
    CMake Warning at C:/Program Files/Cmake/share/cmake-3.8/Modules/FindBoost.cmake:1521 (message):
    No header defined for python3; skipping header check
    Call Stack (most recent call first):
    C:/Users/Lelek/dlib-19.4/dlib/cmake_utils/add_python_module:66 (FIND_PACKAGE)
    CMakeLists.txt:6 (include)
    -- Could NOT find Boost
    -- Could NOT find Boost
    -- Found PythonLibs: C:/ProgramData/Anaconda3/libs/python36.lib (found suitable version "3.6.0", minimum required is "3.4")

-- We couldn't find the right version of boost python.  If you installed boost and you are still getting this error then you might have installed a version of boost that was compiled with a different version of visual studio than the one you are using.  So you have to make sure that the version of visual studio is the same version that was used to compile the copy of boost you are using.
--  Set the BOOST_ROOT and BOOST_LIBRARYDIR environment variables before running cmake.
--  E.g.  Something like this:
--     set BOOST_ROOT=C:\local\boost_1_57_0
--     set BOOST_LIBRARYDIR=C:\local\boost_1_57_0\stage\lib
--
--  You will also likely need to compile boost yourself rather than using one of the precompiled
--  windows binaries.  Do this by going to the folder tools\build\ within boost and running
--  bootstrap.bat.  Then run the command:
--     b2 install
--  And then add the output bin folder to your PATH.  Usually this is the C:\boost-build-engine\bin
--  folder. Finally, go to the boost root and run a command like this:
--     b2 -a --with-python address-model=64 toolset=msvc runtime-link=static
--  When it completes, set BOOST_LIBRARYDIR equal to wherever b2 put the compiled libraries.
--  Note that you will need to set the address-model based on if you want a 32 or 64bit python library.
--
--  Next, when you invoke cmake to compile dlib you may have to use cmake's -G option to set the
--  64 vs. 32bit mode of visual studio.  Also, if you want a Python3 library you will need to
--  add -DPYTHON3=1.  You do this with a statement like:
--     cmake -G "Visual Studio 12 2013 Win64" -DPYTHON3=1 ..\..\tools\python
--  Rather than:
--     cmake ..\..\tools\python
--  Which will build a 32bit Python2 module by default on most systems.
--
--  

CMake Error at C:/Users/Lelek/dlib-19.4/dlib/cmake_utils/add_python_module:116 (message):
   Boost python library not found.
Call Stack (most recent call first):
  CMakeLists.txt:6 (include)

-- Configuring incomplete, errors occurred!
See also "C:/Users/Lelek/dlib-19.4/tools/python/build/CMakeFiles/CMakeOutput.log".

error: cmake configuration failed!

【问题讨论】:

  • "完成后,将 BOOST_LIBRARYDIR 设置为 b2 放置已编译库的位置。" - 但它在哪里?找不到。
  • @Suisse 如果你还在寻找答案,那么寻找诸如“C:\Users\...\boost_1_64_0\stage\lib”之类的目录
  • 我把我的 Windows 笔记本电脑扔进了垃圾桶,得到了一台 Mac。没有问题了。谢谢。

标签: python c++ boost dlib


【解决方案1】:

像往常一样,我一问问题就找到了答案。所以,如果有人会遇到同样的问题:

为了解决他的问题,我删除了 Anaconda,只安装了 Python(3.5.0)。然后使用 PyCharm 更新 dlib。再次,请原谅我的英语不好。

【讨论】:

    【解决方案2】:

    如果还有人遇到此问题,请尝试将 dlib\cmake_utils\add_python_module 中对 FIND_PACKAGE 的所有调用从“Boost”更改为“boost”。为我工作。

    如果在找到 boost 后,安装尝试打开 python27.lib 并失败:

    1. 移除提升。
    2. 在 Anaconda 中激活 py36 环境后,重复原始问题中的步骤 2--6。
    3. 重新运行 dlib 设置。

    后者是我的一个愚蠢的错误,但以防万一。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-04-05
      • 2018-12-19
      • 2016-07-25
      • 2019-01-14
      • 2018-01-14
      • 2016-02-23
      • 2018-09-28
      • 1970-01-01
      相关资源
      最近更新 更多