fatal error: pyconfig.h: 没有那个文件或目录

在编译caffe时出现下面错误

hp@hp-HP-Z8-G4-Workstation:~/caffe$ mkdir build
hp@hp-HP-Z8-G4-Workstation:~/caffe$ make all
PROTOC src/caffe/proto/caffe.proto
CXX .build_release/src/caffe/proto/caffe.pb.cc
CXX src/caffe/parallel.cpp
CXX src/caffe/data_transformer.cpp
CXX src/caffe/layer_factory.cpp
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: 没有那个文件或目录
compilation terminated.
Makefile:591: recipe for target '.build_release/src/caffe/layer_factory.o' failed
make: *** [.build_release/src/caffe/layer_factory.o] Error 1

如果使用系统默认的python路径,那么导入python2

make clean
export CPLUS_INCLUDE_PATH=/usr/include/python2.7
make all 

如果使用Anaconda ,那么导入

make clean
export CPLUS_INCLUDE_PATH=/home/hp/anaconda3/include/python3.5m
make all 

 

你可能感兴趣的:(caffe)