caffe icon indicating copy to clipboard operation
caffe copied to clipboard

Error 'fatal error: pyconfig.h: No such file or directory' when executing 'make pycaffe' on dev-branch

Open teknosains opened this issue 12 years ago • 35 comments

i have the following error when I run 'make pycaffe' on dev branch. im using CPU

/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

Can anybody help , thanks

SOLVED

teknosains avatar May 13 '14 04:05 teknosains

I'm getting the same error, could you please provide some information of how you solved it?

FIXED. PYTHONPATH was wrong...

ssierral avatar May 29 '14 19:05 ssierral

How did you solve it? How to reset PYTHONPATH? It is said to add "export PYTHONPATH=/path/to/caffe/python" to ~/.bashrc . But it is no use. Should I restart my computer?

jiang1st avatar May 30 '14 07:05 jiang1st

same error...

Cheng-Wang avatar May 30 '14 08:05 Cheng-Wang

just this : export PYTHONPATH=/path/to/caffe/python and it works

teknosains avatar May 30 '14 08:05 teknosains

Hi, codetrash, I typed export PYTHONPATH=/home/XXXX/Caffe/python and make pycaffe, but I still get that error, can you help me to fix it ? thanks

Cheng-Wang avatar May 30 '14 08:05 Cheng-Wang

try to 'make clean' , and then 'make all', etc again...

if it doesnt work still...you need to check all dependencies

teknosains avatar May 30 '14 08:05 teknosains

I found that If I use an earlier version of Caffe, there is no error. But when it comes to the latest version (I checked out two days ago), that error occurs.

jiang1st avatar May 30 '14 08:05 jiang1st

yes i experienced that too

.....the installation documentation maybe has not been updated yet...dunno...

teknosains avatar May 30 '14 08:05 teknosains

export CPLUS_INCLUDE_PATH=/usr/include/python2.7 it works for me

ghost avatar Jul 09 '14 10:07 ghost

Thanks @hsinfu , it works for me too!

Romainpaulus avatar Jul 11 '14 00:07 Romainpaulus

Also solve my issue, thank you

ardila avatar Jul 23 '14 21:07 ardila

Thanks @hsinfu , it works!

yanchen036 avatar Aug 08 '14 03:08 yanchen036

@codetrash Thanks! your suggestion works for me

abrocod avatar Dec 01 '15 19:12 abrocod

@ghost thank you! it works for me!

yeyun111 avatar Feb 24 '16 01:02 yeyun111

Thanks @ghost and codetrash, It works after I tried the following 3 steps:

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

yuliliang avatar Mar 14 '16 22:03 yuliliang

Thanks @yuliliang It works for me!

easonzhou avatar Apr 28 '16 12:04 easonzhou

@ghost , Thanks. It worked for me. :+1:

amangupta199334 avatar Apr 29 '16 09:04 amangupta199334

@ghost, thanks. It worked for me. Just curious, how were you able to figure that out?

hnkulkarni avatar Jun 14 '16 18:06 hnkulkarni

@yuliliang Thanks! It works for me too!

Lihua-Jing avatar Jul 27 '16 06:07 Lihua-Jing

Thanks @ghost!

admercs avatar Jul 29 '16 12:07 admercs