Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/python-3.x/15.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/haskell/8.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C++ 安装Dlib时找不到Boost_C++_Python 3.x_Boost_Dlib - Fatal编程技术网

C++ 安装Dlib时找不到Boost

C++ 安装Dlib时找不到Boost,c++,python-3.x,boost,dlib,C++,Python 3.x,Boost,Dlib,我是windows用户,目前正在windows 10上工作。在过去的8小时里,我试图在Python3.5上安装Dlib,但失败了。每当我尝试pip安装Dlib,或尝试在Dlib文件夹中安装python setup.py时,都会收到一条错误消息,说cmake配置失败。而在整个执行过程中,我看不出有什么进展。有人能带我到这里吗 >>python setup.py install running install running bdist_egg running build Detecte

我是windows用户,目前正在windows 10上工作。在过去的8小时里,我试图在Python3.5上安装Dlib,但失败了。每当我尝试pip安装Dlib,或尝试在Dlib文件夹中安装python setup.py时,都会收到一条错误消息,说cmake配置失败。而在整个执行过程中,我看不出有什么进展。有人能带我到这里吗

>>python setup.py install
running install
running bdist_egg
running build
Detected Python architecture: 32bit
Detected platform: win32
Removing build directory C:\Users\Tabish\Desktop\dlib-master\./tools/python/build
Configuring cmake ...
-- Building for: Visual Studio 14 2015
-- The C compiler identification is MSVC 19.0.24213.1
-- The CXX compiler identification is MSVC 19.0.24213.1
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/cl.exe
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/cl.exe -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/cl.exe
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/cl.exe -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Warning at C:/Program Files (x86)/Python35-32/Lib/site-packages/cmake/data/share/cmake-3.7/Modules/FindBoost.cmake:744 (message):
  Imported targets not available for Boost version
Call Stack (most recent call first):
  C:/Program Files (x86)/Python35-32/Lib/site-packages/cmake/data/share/cmake-3.7/Modules/FindBoost.cmake:848 (_Boost_COMPONENT_DEPENDENCIES)
  C:/Program Files (x86)/Python35-32/Lib/site-packages/cmake/data/share/cmake-3.7/Modules/FindBoost.cmake:1435 (_Boost_MISSING_DEPENDENCIES)
  C:/Users/Tabish/Desktop/dlib-master/dlib/cmake_utils/add_python_module:61 (FIND_PACKAGE)
  CMakeLists.txt:6 (include)
CMake Warning at C:/Program Files (x86)/Python35-32/Lib/site-packages/cmake/data/share/cmake-3.7/Modules/FindBoost.cmake:1499 (message):
  No header defined for python-py34; skipping header check
Call Stack (most recent call first):
  C:/Users/Tabish/Desktop/dlib-master/dlib/cmake_utils/add_python_module:61 (FIND_PACKAGE)
  CMakeLists.txt:6 (include)
-- Could NOT find Boost
CMake Warning at C:/Program Files (x86)/Python35-32/Lib/site-packages/cmake/data/share/cmake-3.7/Modules/FindBoost.cmake:744 (message):
  Imported targets not available for Boost version
Call Stack (most recent call first):
  C:/Program Files (x86)/Python35-32/Lib/site-packages/cmake/data/share/cmake-3.7/Modules/FindBoost.cmake:848 (_Boost_COMPONENT_DEPENDENCIES)
  C:/Program Files (x86)/Python35-32/Lib/site-packages/cmake/data/share/cmake-3.7/Modules/FindBoost.cmake:1435 (_Boost_MISSING_DEPENDENCIES)
  C:/Users/Tabish/Desktop/dlib-master/dlib/cmake_utils/add_python_module:63 (FIND_PACKAGE)
  CMakeLists.txt:6 (include)
CMake Warning at C:/Program Files (x86)/Python35-32/Lib/site-packages/cmake/data/share/cmake-3.7/Modules/FindBoost.cmake:1499 (message):
  No header defined for python-py35; skipping header check
Call Stack (most recent call first):
  C:/Users/Tabish/Desktop/dlib-master/dlib/cmake_utils/add_python_module:63 (FIND_PACKAGE)
  CMakeLists.txt:6 (include)
-- Could NOT find Boost
CMake Warning at C:/Program Files (x86)/Python35-32/Lib/site-packages/cmake/data/share/cmake-3.7/Modules/FindBoost.cmake:744 (message):
  Imported targets not available for Boost version
Call Stack (most recent call first):
  C:/Program Files (x86)/Python35-32/Lib/site-packages/cmake/data/share/cmake-3.7/Modules/FindBoost.cmake:848 (_Boost_COMPONENT_DEPENDENCIES)
  C:/Program Files (x86)/Python35-32/Lib/site-packages/cmake/data/share/cmake-3.7/Modules/FindBoost.cmake:1435 (_Boost_MISSING_DEPENDENCIES)
  C:/Users/Tabish/Desktop/dlib-master/dlib/cmake_utils/add_python_module:66 (FIND_PACKAGE)
  CMakeLists.txt:6 (include)
CMake Warning at C:/Program Files (x86)/Python35-32/Lib/site-packages/cmake/data/share/cmake-3.7/Modules/FindBoost.cmake:1499 (message):
  No header defined for python3; skipping header check
Call Stack (most recent call first):
  C:/Users/Tabish/Desktop/dlib-master/dlib/cmake_utils/add_python_module:66 (FIND_PACKAGE)
  CMakeLists.txt:6 (include)
-- Could NOT find Boost
CMake Warning at C:/Program Files (x86)/Python35-32/Lib/site-packages/cmake/data/share/cmake-3.7/Modules/FindBoost.cmake:744 (message):
  Imported targets not available for Boost version
Call Stack (most recent call first):
  C:/Program Files (x86)/Python35-32/Lib/site-packages/cmake/data/share/cmake-3.7/Modules/FindBoost.cmake:848 (_Boost_COMPONENT_DEPENDENCIES)
  C:/Program Files (x86)/Python35-32/Lib/site-packages/cmake/data/share/cmake-3.7/Modules/FindBoost.cmake:1435 (_Boost_MISSING_DEPENDENCIES)
  C:/Users/Tabish/Desktop/dlib-master/dlib/cmake_utils/add_python_module:69 (FIND_PACKAGE)
  CMakeLists.txt:6 (include)
-- Could NOT find Boost
-- Found PythonLibs: C:/Program Files (x86)/Python35-32/libs/python35.lib (found suitable version "3.5.2", 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
error: cmake configuration failed!

请尝试以下步骤:针对Windows进行调整

下载boost源代码包

将cd放入解压缩的boost文件夹中

运行。\bootstrap.bat

运行。\b2运行时链接=共享链接=共享。这将创建自身链接到动态运行库的动态boost lib

当然,在将以下环境变量调整到您自己的路径后设置它们:

BOOST_LIBRARYDIR="C:\Developer\boost_1_62_0\stage\lib"
使用python setup.py安装重试
当CMake的find_包找不到boost时,我遇到了一个类似的问题,原因是使用b2构建boost时,没有参数link=shared,导致生成的.lib文件在Windows上具有前缀lib,而CMake的find_包不希望libs具有lib前缀

尝试以下步骤:针对Windows进行调整

下载boost源代码包

将cd放入解压缩的boost文件夹中

运行。\bootstrap.bat

运行。\b2运行时链接=共享链接=共享。这将创建自身链接到动态运行库的动态boost lib

当然,在将以下环境变量调整到您自己的路径后设置它们:

BOOST_LIBRARYDIR="C:\Developer\boost_1_62_0\stage\lib"
使用python setup.py安装重试
当CMake的find_包找不到boost时,我遇到了一个类似的问题,原因是使用b2构建boost时,没有参数link=shared,导致生成的.lib文件在Windows上具有前缀lib,而CMake的find_包不希望libs具有lib前缀

如果您使用64位版本的python,那么您可以通过pip安装dlib使用预编译二进制文件。不,我使用32位版本@davisi如果您使用64位版本的python,那么您可以通过pip安装dlib使用预编译二进制文件。不,我使用32位版本@davisan其他源告诉我使用bjam。B2和BJAM有什么区别?这里是B2和BJAM之间的区别:在安装VS2015 **更新3 **之前,我没有在Python StupU.Py安装中成功。看来只有这个更新包含了DLIB需要的最新C++标准。B2和BJAM有什么区别?这里是B2和BJAM之间的区别:在安装VS2015 **更新3 **之前,我没有在Python StupU.Py安装中成功。看来只有这个更新包含了DLIB需要的最新C++标准。
BOOST_ROOT="C:\Developer\boost_1_62_0"