I was struggling due to this problem for two days now and got the solution just now so thought I will share it
with you all; as I don’t want anyone else to land up in trouble as i did so I am using Hardy and was trying to build subvertpy from source as the package was not available for same.
The problem occurs due to absence of Python development headers as many python modules have dependency on Python development headers to compile.
Solution is to install development headers using package manager; open the terminal and issue the following commands
and select the package that matches your installation as in my case it is python2.5-dev; issue the following command to install it
This will install development headers in /usr/include/python2.5 and now you can build your python module successfully.
Filed under: OpenSource
Trackback Uri


Thank you very much!
I was upgrading twisted to 9.0.0 with easy_install utility in Ubuntu 9.0 and came across the same problem.
Installing python2.6-dev solved it.
I am glad that it helped you.
Very helpful, thanks!
I am Suse LINUX (11.1)
And when I am including
#include
its not able to find this library.
The above help does’nt work in SUSE LINUX.
Please help .
Thanks
Shariq
I am Suse LINUX (11.1)
And when I am including
#include<Python.h>
its not able to find this library.
The above help does\’nt work in SUSE LINUX.
Please help .
Thanks
Shariq
I am Suse LINUX (11.1)
And when I am including
#include<Python.h>
its not able to find this library.
The above help does\\\’nt work in SUSE LINUX.
Please help .
Thanks
Shariq
I am Suse LINUX (11.1)
And when I am including
#include&lt;Python.h&gt;
its not able to find this library.
The above help does\\\\\\\’nt work in SUSE LINUX.
Please help .
Thanks
Shariq
I am Suse LINUX (11.1)
And when I am including
#include Python.h
its not able to find this library.
The above help does not work in SUSE LINUX.
Please help .
Thanks
Shariq
Do you have the python-devel package installed on your machine?
Thanks so much!
Thank you, thank you, thank you. Your post was the first one I found after encountering this problem, and your solution worked perfectly. Saved me so much time. Much appreciated.
I am glad that it helped you thanks for your kind remarks
Thanks a lot
thanks!
Thank you very much!!!!
I’ve been struggling to this one out for a while. THANK YOU, it’s working now!
Worked perfect. You saved me buckets of time and trouble.
You’re awesome! Thanks for sharing. I ran into this problem two minutes ago, found this page and fixed my problem in two seconds!
Sorry it took you two days…but thanks again for sparing the rest of us the time and trouble!
You are great! Thanks for sharing, this really helps me so much, and I am super happy after solving this problem!
Thanks Vishwajeet
your input is quite helpful.
Reg
Gagan
Thanks that worked for me, using ‘python-dev’
Just wanted to add my voice to the large crowd expressing appreciation that you took the time and effort to post this solution. Saved me quite a bit of pain!
Thanks a lot! Solved my reportlab installation issue on Ubuntu 10.04 server
Thanks very much, Its rare that I find a quick solution for my building problems!
Great!!!
Dude. I fricken love you.
!!!
Thank you so much!! U saved me a lot of time
I am on Ubuntu 11.04. I was trying to install latest Django, and this got me past my problem compiling MySQLdb. You could actually select the python-dev package in synaptic, and it will select the right python release for you (2.7 in my case).
I stopped in just to say that this helped me overcome a problem I was having with cxfreeze on debian stable
So thanks!
Very much appreciated!
sudo apt-get install python2.6-dev
saved me lots of time building yenc on Ubuntu 11.04
This solved problems installing Root with pyroot from trunk on Ubuntu 11.10.
Before, the python command
import ROOT
got me an import error:
import libPyROOT as _root
ImportError: No module named libPyROOT
After running
sudo apt-get install python-dev
and recompiling Root, pyRoot works flawlessly
Thanks !
Thank you!!
Thank u so much:)
How to Install Cyn.in on ubuntu desktop 11.10 ?
Thanks very much for have shared something that might be small but can make you spend valuable time.
it worked! ran into this error while installing orange http://orange.biolab.si/nightly_builds.html thanks a lot! cheers!
Thank you – this post gave me the fix to an issue which has wasted a good 2 hours of my time!
Used it to to a pip install psycopg2 on ubuntu 10.04 with python2.7 added
Thanks for publishing
Great solution to my problem! Thanks!
worked for my ubuntu… thanks!!!
Thank you kind sir.. You saved me hours of hair pulling!
if you would have posted a BTC address, I would have sent you some.. but alas, all i can give in return is kind words and blessings..
I wanted to add another thanks. It’s great to see other people out there like me who want to save others the same hassles.
Thanks a lot…! This helped me while compiling pycrypto
Thanks, so much. This solved my problem on Ubuntu!
Cheers – worked for Ubuntu 11 and Python2.7 but I did need to run apt-get update before the python-dev would install OK.
Thanks again
Thanks! This let me build JCC for PyLucene on Ubuntu 11.10 (oneiric)
thnx man gr8 worked for me….:)