fatal error: pyconfig.h: No such file or directory
程序员文章站
2022-07-01 20:25:17
...
/usr/bin/g++ -shared -o python/caffe/_caffe.so python/caffe/_caffe.cpp \
build/lib/libcaffe.a -pthread -fPIC -DNDEBUG -O2 -I/usr/local/include/python2.7 - I/usr/local/lib/python2.7/dist- packages/numpy/core/include -I/usr/local/include -Ibuild/src -I./src -I./include -I/usr/local/cuda/include -L/usr/local/lib -L/usr/local/lib -L/usr/lib -L/usr/local/cuda/lib64 - L/usr/local/cuda/lib -lcudart -lcublas -lcurand -lpthread -lglog -lprotobuf -lleveldb -lsnappy -lboost_system -lhdf5_hl -lhdf5 -lopencv_core -lopencv_highgui -lopencv_imgproc -lcblas -latlas - lboost_python -lpython2.7
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 python/caffe/_caffe.cpp:8:
/usr/include/boost/python/detail/wrap_python.hpp:50:23: fatal error: pyconfig.h: No such file or directory
compilation terminated.
make: *** [python/caffe/_caffe.so] Error 1
如果使用的是系统的python路径,解决方法如下:
make clean
export CPLUS_INCLUDE_PATH=/usr/include/python2.7
make all -j8
如果使用的是anaconda Python,路径如下:
export CPLUS_INCLUDE_PATH=/home/gpf/anaconda3/include/python3.6m
推荐阅读
-
在Linux中修复“fatal error: x264.h: No such file or directo”错误的方法
-
NET下编译C++代码时出现fatal error C1083: 无法打开包含文件:“iostream.h”: No such file or director
-
Python Error: /usr/bin/env: python3: No such file or directory
-
VMWare 15 Error on Ubuntu 18.4 - Could not open /dev/vmmon: No such file or directory
-
error trying to exec 'cc1plus': execvp: No such file or directory
-
Error: ENOENT: no such file or directory, uv_cwd Error: Cannot find module
-
Linux内核编译时出现fatal error: openssl/opensslv.h: No such file or directory错误的解决办法
-
/usr/include/gnu/stubs.h:7:27: fatal error: gnu/stubs-32.h: No such file or directory
-
scripts/sign-file.c:25:30: fatal error: openssl/opensslv.h: No such file or directory
-
交叉编译BusyBox 构建根文件系统出错fatal error: gnu/stubs-soft.h: No such file or directory