2017-05-03 59 views
1

(請原諒我的英文不好!)嘗試在我的電腦上安裝dlib庫(Windows 10 Pro,64x)時陷入陷阱,但始終得到相同的錯誤:可能不找升壓Dlib安裝錯誤:無法找到升壓

我已經這樣做:

  1. 安裝了Visual Studio 2017年社區版15.1
  2. 安裝蟒:Python的3.6.0 |蟒蛇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.Next:

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.在這個階段,如果我嘗試到run python setup.py install從DLIB目錄中我得到的輸出(當試圖調用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! 
+0

」完成後,將BOOST_LIBRARYDIR設置爲等於b2放置編譯庫的位置。「 - 但它在哪裏?找不到。 – Suisse

+0

@Suisse如果你仍然在尋找答案,然後尋找目錄,如「C:\ Users \ ... \ boost_1_64_0 \ stage \ lib」 –

+0

我已經把我的Windows筆記本電腦扔進垃圾箱,並得到了一臺Mac。沒有問題了。謝謝。 – Suisse

回答

0

像往常一樣對我來說,我找到了答案,只要我問問題。所以,如果有人會得到相同的問題:

爲了解決他的問題,我刪除了Anaconda並只安裝了Python(3.5.0)。然後使用PyCharm更新dlib。再說一次,請原諒我的壞英語。

1

如果有人仍然存在這個問題,請嘗試將所有調用改爲將FIND_PACKAGE內的dlib \ cmake_utils \ add_python_module從'Boost'改爲'boost'。爲我工作。

如果發現升壓後,安裝試圖打開python27.lib和失敗:

  1. 刪除提升。
  2. 在Anaconda激活py36環境後,重複步驟2-6中的原始問題。
  3. 重新運行dlib設置。

後者是我的一個愚蠢的錯誤,但以防萬一。 「