caffe编译:fatal error: pyconfig.h: No such file or directory #include "pyconfig.h"

在网上搜了相关解决方法

其中 ,有的方法不可行,有的方法不全面,

经过个人尝试,可以采用以下完备方案:

首先尝试

修改Makefile.config,将
PYTHON_INCLUDE := $(ANACONDA_HOME)/include \
#                 $(ANACONDA_HOME)/include/python2.7 \
#                 $(ANACONDA_HOME)/lib/python2.7/site-packages/numpy/core/include \
取消以下2行注释
PYTHON_INCLUDE := $(ANACONDA_HOME)/include \
$(ANACONDA_HOME)/include/python2.7 \
$(ANACONDA_HOME)/lib/python2.7/site-packages/numpy/core/include \
如果继续报错,则 执行 locate pyconfig.h

找到/usr/include/python2.7 /pyconfig.h

尝试执行export CPLUS_INCLUDE_PATH=/usr/include/python2.7 

后 再执行make all 依然报错

最后 只能把

PYTHON_INCLUDE := $(ANACONDA_HOME)/include \
$(ANACONDA_HOME)/include/python2.7 \
$(ANACONDA_HOME)/lib/python2.7/site-packages/numpy/core/include \
改为

PYTHON_INCLUDE := $(ANACONDA_HOME)/include \
$(ANACONDA_HOME)/include/python2.7 \
$(ANACONDA_HOME)/lib/python2.7/site-packages/numpy/core/include \
/usr/include/python2.7 

编译通过

你可能感兴趣的:(深度学习,深度学习',caffe)