【问题标题】:/usr/include/boost/python/detail/wrap_python.hpp:50:23: fatal error: pyconfig.h: No such file or directory/usr/include/boost/python/detail/wrap_python.hpp:50:23:致命错误:pyconfig.h:没有这样的文件或目录
【发布时间】:2016-08-23 22:54:22
【问题描述】:

我收到此错误:

(cv) jalal@klein:~/computer_vision/py-faster-rcnn/caffe-fast-rcnn$ make -j8 && make pycaffe
PROTOC src/caffe/proto/caffe.proto
CXX src/caffe/blob.cpp
CXX src/caffe/data_reader.cpp
CXX src/caffe/layer.cpp
CXX src/caffe/solvers/adadelta_solver.cpp
CXX src/caffe/solvers/rmsprop_solver.cpp
CXX src/caffe/solvers/adagrad_solver.cpp
CXX src/caffe/solvers/nesterov_solver.cpp
CXX src/caffe/solvers/sgd_solver.cpp
CXX src/caffe/solvers/adam_solver.cpp
CXX src/caffe/syncedmem.cpp
CXX src/caffe/common.cpp
CXX src/caffe/internal_thread.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: No such file or directory
compilation terminated.
Makefile:565: recipe for target '.build_release/src/caffe/layer_factory.o' failed
make: *** [.build_release/src/caffe/layer_factory.o] Error 1
make: *** Waiting for unfinished jobs....

在 Makefile.config 我有:

PYTHON_INCLUDE := /use/include/python3.4

在 Makefile 我有:

#PYTHON_LIBRARIES ?= boost_python python2.7
PYTHON_LIBRARIES ?= boost_python python3.4

我正在使用虚拟环境通过 Python3.4.3+ 运行 OpenCV3:

(cv) jalal@klein:~/computer_vision/py-faster-rcnn/caffe-fast-rcnn$ python --version
Python 3.4.3+

但是在 /usr/include 我有这些 Python,我不确定哪一个实际上是用于 Python3.4.3+:

$ ls /usr/include/python
python2.7/  python3.4/  python3.4m/ python3.5m/ 

$ ls /usr/include/python3.4m/
abstract.h         ceval.h                enumobject.h   Imaging.h       metagrammar.h      parsetok.h     pyerrors.h     pystrcmp.h      structseq.h
accu.h             classobject.h          errcode.h      ImDib.h         methodobject.h     patchlevel.h   pyexpat.h      pystrtod.h      symtable.h
asdl.h             codecs.h               eval.h         ImPlatform.h    modsupport.h       pgen.h         pyfpe.h        Python-ast.h    sysmodule.h
ast.h              code.h                 fileobject.h   import.h        moduleobject.h     pgenheaders.h  pygetopt.h     Python.h        token.h
bitset.h           compile.h              fileutils.h    intrcheck.h     namespaceobject.h  pyarena.h      pyhash.h       pythonrun.h     traceback.h
bltinmodule.h      complexobject.h        floatobject.h  iterobject.h    node.h             pyatomic.h     pymacconfig.h  pythread.h      tupleobject.h
boolobject.h       datetime.h             frameobject.h  listobject.h    numpy              pycapsule.h    pymacro.h      pytime.h        typeslots.h
bytearrayobject.h  descrobject.h          funcobject.h   longintrepr.h   object.h           pyconfig.h     pymath.h       rangeobject.h   ucnhash.h
bytes_methods.h    dictobject.h           genobject.h    longobject.h    objimpl.h          pyctype.h      pymem.h        setobject.h     unicodeobject.h
bytesobject.h      dtoa.h                 graminit.h     marshal.h       opcode.h           py_curses.h    pyport.h       sliceobject.h   warnings.h
cellobject.h       dynamic_annotations.h  grammar.h      memoryobject.h  osdefs.h           pydebug.h      pystate.h      structmember.h  weakrefobject.h
$ ls /usr/include/python3.4
abstract.h         ceval.h                enumobject.h   Imaging.h       metagrammar.h      parsetok.h     pyerrors.h     pystrcmp.h      structseq.h
accu.h             classobject.h          errcode.h      ImDib.h         methodobject.h     patchlevel.h   pyexpat.h      pystrtod.h      symtable.h
asdl.h             codecs.h               eval.h         ImPlatform.h    modsupport.h       pgen.h         pyfpe.h        Python-ast.h    sysmodule.h
ast.h              code.h                 fileobject.h   import.h        moduleobject.h     pgenheaders.h  pygetopt.h     Python.h        token.h
bitset.h           compile.h              fileutils.h    intrcheck.h     namespaceobject.h  pyarena.h      pyhash.h       pythonrun.h     traceback.h
bltinmodule.h      complexobject.h        floatobject.h  iterobject.h    node.h             pyatomic.h     pymacconfig.h  pythread.h      tupleobject.h
boolobject.h       datetime.h             frameobject.h  listobject.h    numpy              pycapsule.h    pymacro.h      pytime.h        typeslots.h
bytearrayobject.h  descrobject.h          funcobject.h   longintrepr.h   object.h           pyconfig.h     pymath.h       rangeobject.h   ucnhash.h
bytes_methods.h    dictobject.h           genobject.h    longobject.h    objimpl.h          pyctype.h      pymem.h        setobject.h     unicodeobject.h
bytesobject.h      dtoa.h                 graminit.h     marshal.h       opcode.h           py_curses.h    pyport.h       sliceobject.h   warnings.h
cellobject.h       dynamic_annotations.h  grammar.h      memoryobject.h  osdefs.h           pydebug.h      pystate.h      structmember.h  weakrefobject.h

我在 bashrc 中有这个用于我的虚拟环境:

export VIRTUALENVWRAPPER_PYTHON=/usr/bin/python3
export WORKON_HOME=$HOME/.virtualenvs
source /usr/local/bin/virtualenvwrapper.sh

基本上如何设置 Caffe 以使用 Python3.4.3+? https://github.com/rbgirshick/py-faster-rcnn

【问题讨论】:

  • 你在你的问题中说你的 Makefile 中的一行是PYTHON_INCLUDE := /use/include/python3.4。实际路径是/usr/include/python3.4m - 你写的是/use 而不是/usr,忘记将m 附加到python3.4

标签: python python-3.x ubuntu makefile caffe


【解决方案1】:

使用这个

sudo apt-get install python-dev python3-dev

【讨论】:

    猜你喜欢
    • 2023-03-29
    • 2019-12-06
    • 2018-11-03
    • 2019-03-09
    • 2016-08-29
    • 2015-01-11
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多