(cd ./brain/psom && make)
make[1]: Entering directory `/home/ubuntu/pyrobot/brain/psom'
(cd csom_src && make _csom.so)
make[2]: Entering directory `/home/ubuntu/pyrobot/brain/psom/csom_src'
gcc -c -g -I -I/usr/include/python2.6 som_pak_wrap.c -I/usr/include/python2.6 -Isom_pak-dev
som_pak_wrap.c:125: fatal error: Python.h: No such file or directory
compilation terminated.
make[2]: *** [som_pak_wrap.o] Error 1
make[2]: Leaving directory `/home/ubuntu/pyrobot/brain/psom/csom_src'
make[1]: *** [csom_src/_csom.so] Error 2
make[1]: Leaving directory `/home/ubuntu/pyrobot/brain/psom'
make: *** [brain/psom] Error 2
To fix
sudo apt-get install python2.6-dev
Cheers, that was helpful.
I am building SIP from http://www.riverbankcomputing.co.uk/ and i encountered similar error
i typed “sudo apt-get install python2.7-dev”
thanks.
[…] Alex Sleat — How To Fix: fatal error: Python.h: No such file or directory Cancel […]
Thanks a lot, this solved my trouble!
Thanks! I used python2.7-dev and it worked great.
Hi there, You’ve performed a great job. I’ll certainly digg it and for my part recommend to my friends. I’m sure they’ll be benefited from this web site.
[…] http://blog.csdn.net/Hello_Orange/article/details/61844206 Python.h:No such file or directory – Hello_Orange的专栏 – 博客频道 – CSDN.NET http://alexsleat.co.uk/2011/01/01/fatal-error-python-h-no-such-file-or-directory/ […]
Thank you , you solve my problem !!
[…] http://blog.csdn.net/Hello_Orange/article/details/61844206 Python.h:No such file or directory – Hello_Orange的专栏 – 博客频道 – CSDN.NET http://alexsleat.co.uk/2011/01/01/fatal-error-python-h-no-such-file-or-directory/ […]
Hi,I have the same problem,and using apt -cache search python ,I cannot find any available version of python-dev. Do you know the reason and what should I do?
Thanks a lot!
@xixi try this:
apt-cache search python | grep dev
That will show you the available versions
Thanks a lot! It made my day :)
Thanks worked like a charm!
You Rock!
Super helpful. Thanks!
Or for fedora
$ sudo yum install python-devel
cheers!
hi all,
python is installed and also python-dev, but i became the error
/home/pi/OpenCV-2.4.2/modules/python/src2/cv2.cpp:1:20 fatal error: Python.h: No such file or directory
i use debian and a raspberry pi
any ideas?
Thanks!
On Ubuntu 12.04.1 Server I got that error building MySQLdb and fixed it with
sudo apt-get install python-all-dev
sudo apt-get install python-all-dev
or
sudo apt-get install python2.7-dev
both OK!
Thanks!
sudo apt-get install python2.7-dev
This solved my problem :)
thanks
Thx,
sudo apt-get install python-dev
will install dev for for the installed version of python.
Python 2.7 is already installed and Python.h exists and in right directory but I still have this error:
gamal@ubuntu:~/Downloads/article_res/Test2$ g++ -o Main Main.c -I/user/include/python2.7/Python.h -L/usr/lib/python2.7/config -Xlinker -export-dynamic -lpython2.7 -lm -lpthread -ltk -lutil
Main.c:7:20: fatal error: Python.h: No such file or directory
compilation terminated.
Any help?
Good post gave me directions to fixing the problem. Installing python2.6-dev didn’t fix anything for me, but installing python2.7-dev did. Cheers for the post.
Hey,
in my case, the gunicorn call needed the additional argument “-k gevent” in order to prevent client timeout errors while pushing, e.g.,
“2014/02/13 12:49:41 Error: push: Invalid Registry endpoint: Get http://localhost:5000/v1/_ping: read tcp 127.0.0.1:5000: i/o timeout”
Cheers