/usr/include/boost/python/detail/wrap_python.hpp:50:23: fatal error: pyconfig.h: No such file or dir

caffe编译报错:

/usr/include/boost/python/detail/wrap_python.hpp:50:23: fatal error: pyconfig.h: No such file or directory
compilation terminated.
Makefile:582: recipe for target '.build_release/tools/caffe.o' failed
make: *** [.build_release/tools/caffe.o] Error 1
make: *** Waiting for unfinished jobs....
In file included from /usr/include/boost/python/detail/prefix.hpp:13:0,
                 from /usr/include/boost/python/args.hpp:8,
                 from /usr/include/boost/python.hpp:11,
                 from src/caffe/layer_factory.cpp:4:
/usr/include/boost/python/detail/wrap_python.hpp:50:23: fatal error: pyconfig.h: No such file or directory

这应该是缺少python头文件,我使用的是系统自带的python3.5,在Makefile.config中对python的配置如下:

 PYTHON_LIBRARIES := boost_python3 python3.5m
 PYTHON_INCLUDE := /usr/include/python3.5 \
                 /usr/local/lib/python3.5/dist-packages/numpy/core/include

仔细查了之后发现/usr/include/python3.5 路径并不存在,查了半天终于找到了答案,通过安装python3-dev可以解决

python-dev是干什么用的呢: 
linux发行版通常会把类库的头文件和相关的pkg-config分拆成一个单独的xxx-dev(el)包. 
以python为例, 以下情况是需要python-dev的: 
你需要自己安装一个源外的python类库, 而这个类库内含需要编译的调用python api的c/c++文件。 
你自己写的一个程序编译需要链接libpythonXX.(a|so) 
(注:以上不含使用ctypes/ffi或者裸dlsym方式直接调用libpython.so) 
其他正常使用python或者通过安装源内的python类库的不需要python-dev.

 

参考链接:https://blog.csdn.net/qlynh/article/details/72459527

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值