ubuntu18.04 anaconda安装caffe报错
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 tools/caffe.cpp:2:
/usr/include/boost/python/detail/wrap_python.hpp:50:11: fatal error: pyconfig.h: No such file or directory
# include <pyconfig.h>
^~~~~~~~~~~~
compilation terminated.
Makefile:593: recipe for target '.build_release/tools/caffe.o' failed
make: *** [.build_release/tools/caffe.o] Error 1
make: *** Waiting for unfinished jobs....
解决方法:
make clean
export CPLUS_INCLUDE_PATH=/你的anconda路径/include/python2.7
export PYTHONPATH=/home/administrator/storage2/xxy/caffe-master/python
修改Makefile.config文件中
INCLUDE_DIRS := $(PYTHON_INCLUDE) /usr/local/include /usr/include /home/administrator/anaconda3/envs/caffe2.7/include /usr/include/hdf5/serial /usr/local/cuda-10.0/include
为
INCLUDE_DIRS := $(PYTHON_INCLUDE) /usr/local/include /usr/include /home/administrator/anaconda3/envs/caffe2.7/include/python2.7 /usr/include/hdf5/serial /usr/local/cuda-10.0/include
sudo make -j8