Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fatal error: pyconfig.h: No such file or directory #489

Closed
pcmoritz opened this issue Jun 11, 2014 · 17 comments
Closed

fatal error: pyconfig.h: No such file or directory #489

pcmoritz opened this issue Jun 11, 2014 · 17 comments

Comments

@pcmoritz
Copy link

Dear all,

if I clone the latest version of caffe from github and run 'make pycaffe', I get the following error:

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

I put the python subdirectory in my PYTHONPATH. This is a copy of #410, which still persists. Any help would be appreciated.

Best,
Philipp.

@longjon
Copy link
Contributor

longjon commented Jun 11, 2014

Are the appropriate headers and libraries installed for Python development on your system? Are they accessible from the paths defined by PYTHON_INCLUDES and PYTHON_LIB in Makefile.config?

(By the way, why don't we use python-config for setting those variables automatically?)

@shelhamer
Copy link
Member

@longjon I think we don't automatically configure python in case of
multiple python installs and/or users who have a system python but really
would have a better life with Anaconda and so on.

Le mardi 10 juin 2014, longjon notifications@github.com a écrit :

Are the appropriate headers and libraries installed for Python development
on your system? Are they accessible from the paths defined by
PYTHON_INCLUDES and PYTHON_LIB in Makefile.config?

(By the way, why don't we use python-config for setting those variables
automatically?)


Reply to this email directly or view it on GitHub
#489 (comment).

Evan Shelhamer

@longjon
Copy link
Contributor

longjon commented Jun 11, 2014

@shelhamer that's sensible enough, although surely the user's PATH should contain the desired python, and therefore the desired python-config? (Otherwise things are likely to go poorly when the user launches python and imports pycaffe built against a different Python, as we've seen happen before.)

In any case building against Anaconda explicitly is a commented option in Makefile.config.example, the question is just what the default should be.

@pcmoritz
Copy link
Author

Thank you for your help, adding
/usr/include/python2.7/
to the PYTHON_INCLUDE list in Makefile.config did the trick.

crizCraig added a commit to crizCraig/caffe that referenced this issue Oct 16, 2014
crizCraig added a commit to crizCraig/caffe that referenced this issue Oct 16, 2014
@crizCraig
Copy link
Contributor

Specifying the correct anaconda location fixed this for me. See pull request #1296. So I changed ANACONDA_HOME to /anaconda.

RazvanRanca pushed a commit to RazvanRanca/caffe that referenced this issue Nov 4, 2014
cbfinn pushed a commit to cbfinn/caffe that referenced this issue Feb 26, 2015
slayton58 pushed a commit to slayton58/caffe that referenced this issue Mar 4, 2015
@admercs
Copy link

admercs commented Jul 29, 2016

This work for me (source):

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

@ghost
Copy link

ghost commented Sep 2, 2016

I also meet this problem... and try to close it.

@ShivangiM
Copy link

Thanks @adam-erickson it worked for me too.

@dookdick
Copy link

@adam-erickson how and where should I run/put those lines in your comments? I'm quite new on Ubuntu so I need more details on this.

@chenchongsong
Copy link

@adam-erickson Thanks!!!

@alexjingjing
Copy link

@adam-erickson Thank you so much!

@adu81020799
Copy link

Thanks this helped me too

@luyao777
Copy link

export CPLUS_INCLUDE_PATH=/usr/include/python2.7

That's work for me! Thanks

@jahab
Copy link

jahab commented Dec 5, 2019

changing the gcc version resolved my error. I configured to gcc6 from gcc7. https://medium.com/@atinesh/ubuntu-tips-and-tricks-configuring-multiple-gcc-in-same-ubuntu-machine-a391a34d79c2

@rajhlinux
Copy link

I tried all answers on this thread, none works for me on FreeBSD 13.1, using clang 13... whats the deal here?

@arjunskumar
Copy link

for ROS-noetic users

export CPLUS_INCLUDE_PATH=/usr/include/python3.8
catkin build pkg-name

@dragonQian
Copy link

dragonQian commented Oct 31, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests