16 Sep 09

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

sudo apt-cache search python

and select the package that matches your installation as in my case it is python2.5-dev; issue the following command to install it

sudo apt-get install python2.5-dev

This will install development headers in /usr/include/python2.5 and now you can build your python module successfully.


Filed under: OpenSource

Trackback Uri


37 Comments.

  • nata says:

    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.

  • tghasd says:

    Very helpful, thanks!

  • Shariq says:

    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

  • Shariq says:

    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

  • Shariq says:

    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

  • Shariq says:

    I am Suse LINUX (11.1)
    And when I am including
    #include&amp;lt;Python.h&amp;gt;
    its not able to find this library.

    The above help does\\\\\\\’nt work in SUSE LINUX.
    Please help .

    Thanks
    Shariq

  • Shariq says:

    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?

  • Rob says:

    Thanks so much!

  • stephenrs says:

    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 :)

  • bill says:

    Thanks a lot :-)

  • thank you says:

    thanks!

  • moin says:

    Thank you very much!!!!

  • scattel2z says:

    I’ve been struggling to this one out for a while. THANK YOU, it’s working now!

  • rajn says:

    Worked perfect. You saved me buckets of time and trouble.

  • Karim Mattar says:

    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!

  • Eric says:

    You are great! Thanks for sharing, this really helps me so much, and I am super happy after solving this problem!

  • Gagan says:

    Thanks Vishwajeet

    your input is quite helpful.

    Reg
    Gagan

  • Matt says:

    Thanks that worked for me, using ‘python-dev’

  • Ben says:

    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!

  • JC says:

    Thanks a lot! Solved my reportlab installation issue on Ubuntu 10.04 server :)

  • Daniela says:

    Thanks very much, Its rare that I find a quick solution for my building problems!
    Great!!!

  • Ben says:

    Dude. I fricken love you.
    !!!

  • Dhivya says:

    Thank you so much!! U saved me a lot of time :)

  • Nara Narasimhan says:

    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).

  • Stratus says:

    I stopped in just to say that this helped me overcome a problem I was having with cxfreeze on debian stable

    So thanks!

  • Andreas says:

    Very much appreciated!

    sudo apt-get install python2.6-dev

    saved me lots of time building yenc on Ubuntu 11.04

  • Schuh says:

    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 !

  • trantor says:

    Thank you!!

  • Chaya says:

    Thank u so much:)

  • David says:

    How to Install Cyn.in on ubuntu desktop 11.10 ?

  • Guido Cecilio says:

    Thanks very much for have shared something that might be small but can make you spend valuable time.

  • carlos josé duarte (@tulakalbeyo) says:

    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

  • thanks says:

    worked for my ubuntu… thanks!!!



Leave a Comment