2017-03-16 79 views
2

我沿着這個tutorial關注如何使用Python進行簡單的人臉識別。本教程依賴於我試圖安裝的dlib庫。然而,DLIB庫對Boost庫的依賴,併產生這個錯誤:未能在Python中安裝Boost - pyconfig.h未找到

-- Found PythonLibs: /Library/Frameworks/Python.framework/Versions/3.6/lib/libpython3.6.dylib (found suitable version "3.6.0", minimum required is "3.4") 
-- ***************************************************************************************************** 
-- To compile Boost.Python yourself download boost from boost.org and then go into the boost root folder 
-- and run these commands: 
--  ./bootstrap.sh --with-libraries=python 
--  ./b2 
--  sudo ./b2 install 

當我從升壓下載文件夾中,我得到以下錯誤運行./bootstrap.sh --with-libraries=python

darwin.compile.c++ bin.v2/libs/python/build/darwin-4.2.1/release/threading-multi/numeric.o 
In file included from libs/python/src/numeric.cpp:6: 
In file included from ./boost/python/numeric.hpp:8: 
In file included from ./boost/python/detail/prefix.hpp:13: 
./boost/python/detail/wrap_python.hpp:50:11: fatal error: 'pyconfig.h' file not found 
# include <pyconfig.h> 
     ^
1 error generated. 

    "g++" -ftemplate-depth-128 -O3 -Wall -dynamic -gdwarf-2 -fexceptions -Wno-inline -fPIC -arch x86_64 -DBOOST_ALL_NO_LIB=1 -DBOOST_PYTHON_SOURCE -DNDEBUG -I"." -I"/Users/mikkeld/anaconda/include/python3.5" -c -o "bin.v2/libs/python/build/darwin-4.2.1/release/threading-multi/numeric.o" "libs/python/src/numeric.cpp" 

我是有點在這裏失去,並試圖環顧四周,沒有運氣。任何人都可以發現問題是什麼?

+0

嘗試:http://stackoverflow.com/questions/19810940/ubuntu-linking-boost-python-fatal-error-pyconfig-cannot-be-found – YellowPillow

回答

0

我在編譯boost時遇到了這個問題,下面是我的解決方案。

  1. 安裝Python
  2. 編輯/ etc/profile文件,並添加以下的文件,你應該修改路徑指定您的蟒蛇頭

    C_INCLUDE_PATH = $ C_INCLUDE_PATH:在/ usr /本地/包括/python3.6m

    出口C_INCLUDE_PATH

    CPLUS_INCLUDE_PATH = $ CPLUS_INCLUDE_PATH:/usr/local/include/python3.6m

    出口CPLUS_INCLUDE_PATH

  3. 源/ etc/profile文件

  4. 編譯再次

它爲我,希望你如此。