Dlib安装错误:找不到Boos

2024-10-01 17:41:30 发布

您现在位置:Python中文网/ 问答频道 /正文

(请原谅我糟糕的英语!)尝试在我的计算机上安装dlib库(Windows10Pro,64x)时陷入陷阱,但一直都有相同的错误:找不到Boost

我已经做了些什么:

  1. 已安装Visual Studio社区2017版本15.1
  2. 安装的Python: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. Ran引导
  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时会出现相同的错误):

^{pr2}$
-- 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!

Tags: ofthetocmakeyouversionthistools
2条回答

如果仍有人遇到此问题,请尝试将dlib\cmake\u utils\add_python_模块中的所有调用从“Boost”更改为“Boost”。为我工作。在

如果python27在找到安装后尝试打开boost:

  1. 拆下增压器。在
  2. 激活Python中的py36环境后,重复原始问题中的步骤26。在
  3. 重新运行dlib安装程序。在

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

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

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

相关问题 更多 >

    热门问题