問題
/boost/python/detail/wrap_python.hpp:50:23: fatal error: pyconfig.h No such file or directory
原因
boost原始腳本錯(cuò)誤伍玖。python2和python3的pyconfig.h文件路徑名字有區(qū)別,安裝腳本默認(rèn)采用python2纫版,如果有更新到python3的則會(huì)出錯(cuò)。
#我的環(huán)境路徑如下
#python2
/usr/include/python2.7/pyconfig.h
#python3(我的anaconda裝在系統(tǒng)目錄)
/usr/include/python3.7m/pyconfig.h
由上可看出婆廊,python3多了個(gè)m.
解決方案
修改python.jam, 該腳本在/boost_1_72_0/tools/build/src/tools/python.jam.具體根據(jù)自己版本。
修改腳本中一處地方巫橄,大概在500多行淘邻。
includes ?= $(prefix)/include/python$(version)
改為
includes ?= $(prefix)/include/python$(version)m