WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: {SOLVED} Compiling pygtk-2,12,1 error headers not found.  (Read 18019 times)

Offline kagashe

  • Full Member
  • ***
  • Posts: 129
    • My Tryst with Linux
{SOLVED} Compiling pygtk-2,12,1 error headers not found.
« on: December 22, 2008, 07:10:40 AM »
I am trying to compile pygtk-2.12.1 and getting error:
Quote
Checking for headers required to compile python extensions... not found
configure: error: could not find Python headers.
I have loaded python and python-devs

kagashe

This is how it was solved:
I used python and python-dev .tce packages instead .tcz and the headers were detected. I don't know why it did not work on .tcz although, headers were in the same location.
« Last Edit: December 25, 2008, 01:32:15 AM by kagashe »

Offline Jason W

  • Administrator
  • Hero Member
  • *****
  • Posts: 9730
Re: Compiling pygtk-2,12,1 error headers not found.
« Reply #1 on: December 22, 2008, 07:22:18 AM »
I assume you also issued:

export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:/usr/lib/pkgconfig

That is of course needed when building against most extensions.

Offline kagashe

  • Full Member
  • ***
  • Posts: 129
    • My Tryst with Linux
Re: Compiling pygtk-2,12,1 error headers not found.
« Reply #2 on: December 22, 2008, 07:38:41 AM »
I assume you also issued:

export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:/usr/lib/pkgconfig

That is of course needed when building against most extensions.
yes.

kagashe

Offline Jason W

  • Administrator
  • Hero Member
  • *****
  • Posts: 9730
Re: Compiling pygtk-2,12,1 error headers not found.
« Reply #3 on: December 22, 2008, 08:03:14 AM »
I am not on TC now and won't be until Friday, but one more thought would be to

export CPPFLAGS="-I/usr/local/include"

if the Python.h is under /usr/local/include. 

Offline kagashe

  • Full Member
  • ***
  • Posts: 129
    • My Tryst with Linux
Re: Compiling pygtk-2,12,1 error headers not found.
« Reply #4 on: December 22, 2008, 08:14:58 AM »
I am not on TC now and won't be until Friday, but one more thought would be to

export CPPFLAGS="-I/usr/local/include"

if the Python.h is under /usr/local/include. 
it is at /usr/local/include/python2.5

kagashe

Offline Jason W

  • Administrator
  • Hero Member
  • *****
  • Posts: 9730
Re: Compiling pygtk-2,12,1 error headers not found.
« Reply #5 on: December 22, 2008, 01:17:52 PM »
One more thing, do you also have pygobject and pycairo built, and perhaps libglade loaded?  Looking around those seem to also be dependencies.  That is of course in addition to the usual gtk-dev stuff which I am sure you already have loaded.

Pygtk was on the list of things I was going to build since there is an Mplayer front end that uses it I would like to try.  Pygobject as well as pycairo if they are needed could go in the same extension as pygtk.  I am able to sneak about an hour with TC now so I will try to help see what the issue is.  I wil let you know if I see what is causing an error.

Offline Jason W

  • Administrator
  • Hero Member
  • *****
  • Posts: 9730
Re: Compiling pygtk-2,12,1 error headers not found.
« Reply #6 on: December 22, 2008, 02:15:32 PM »
I was able to compile pygtk with the above mentioned stuff.  Basically:

Load Xorg-devs and gtk2-devs and dependencies ( I will create a dependency file for gtk2-devs as it is quite a list and I get tired of hunting them down after a clean install. ) python/devs and libglade.

Be prepared for the usual issue of some Xlib .la files in /usr/local/lib instead of /usr/lib.  Pycairo will complain of missing .la files in /usr/lib as they are located in /usr/local/lib.

Build and install pygobject, pycairo, and then pygtk.

Let us know if there are any other  issues with the build.



« Last Edit: December 22, 2008, 02:53:25 PM by Jason W »

Offline kagashe

  • Full Member
  • ***
  • Posts: 129
    • My Tryst with Linux
Re: Compiling pygtk-2,12,1 error headers not found.
« Reply #7 on: December 23, 2008, 03:30:58 AM »
Be prepared for the usual issue of some Xlib .la files in /usr/local/lib instead of /usr/lib.  Pycairo will complain of missing .la files in /usr/lib as they are located in /usr/local/lib
What to do for the errors?
Quote
grep: /usr/lib/libexpat.la: No such file or directory
/bin/sed: can't read /usr/lib/libexpat.la: No such file or directory
libtool: link: '/usr/libexpat.la' is not a valid libtool archive
make[2]: *** [_cairo.la] Error 1
make[2]: Leaving directory '/tmp/pycairo-1.4.0'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/tmp/pycairo-1.4.0'
make: *** [all] Error 2

kagashe

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14516
Re: Compiling pygtk-2,12,1 error headers not found.
« Reply #8 on: December 23, 2008, 04:32:45 AM »
from the error message, either you don't have the expat2/expat2-devs extensions loaded or you need PKG_CONFIG_PATH=/usr/lib/pkgconfig:/usr/local/lib/pkgconfig"

Offline kagashe

  • Full Member
  • ***
  • Posts: 129
    • My Tryst with Linux
Re: Compiling pygtk-2,12,1 error headers not found.
« Reply #9 on: December 23, 2008, 04:44:12 AM »
from the error message, either you don't have the expat2/expat2-devs extensions loaded or you need PKG_CONFIG_PATH=/usr/lib/pkgconfig:/usr/local/lib/pkgconfig"
libexpat.la is there is /usr/local/lib
Make is looking for in /usr/lib

PKG_CONFIG_PATH has been set.

kagashe

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14516
Re: Compiling pygtk-2,12,1 error headers not found.
« Reply #10 on: December 23, 2008, 04:49:17 AM »
you might be be able to get by if you make symlinks to the missing libs, eg:
Code: [Select]
$ sudo ln -s /usr/local/lib/libexpat.la /usr/lib

Offline kagashe

  • Full Member
  • ***
  • Posts: 129
    • My Tryst with Linux
Re: Compiling pygtk-2,12,1 error headers not found.
« Reply #11 on: December 23, 2008, 05:01:08 AM »
you might be be able to get by if you make symlinks to the missing libs, eg:
Code: [Select]
$ sudo ln -s /usr/local/lib/libexpat.la /usr/lib
Then it is complaining for next libXrender.la
then next libX11.la

How can I go on setting symlinks?

kagashe

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14516
Re: Compiling pygtk-2,12,1 error headers not found.
« Reply #12 on: December 23, 2008, 06:00:43 AM »
Code: [Select]
$ sudo ln -s /usr/local/lib/libXrender.la /usr/lib
$ sudo ln -s /usr/local/lib/libX11.la /usr/lib

..but it might be better to try "export LDFLAGS=$LDFLAGS:/usr/local/lib" and then run ./configure again?

Offline Jason W

  • Administrator
  • Hero Member
  • *****
  • Posts: 9730
Re: Compiling pygtk-2,12,1 error headers not found.
« Reply #13 on: December 23, 2008, 07:32:16 AM »
expat dev files get installed by three different extensions- Xorg-dev, expat-dev, and perl_xml.  So they are present in both /usr/lib and /usr/local/lib.  That is ok since they are all the same version.  So by all means expat should be detected as present.  But somewhare some files get lost since I noticed the same error with expat. 

Xorg-dev places it's .la and .a files in /usr/local/lib though the ones whose shared libs are in /usr/lib seem to expect to find the .a and .la files there when compiling.  I may soon move files around in my own copy of xorg-dev and edit the pkgconfig files and see if that helps as I run into this issue every time I compile anything involving X.

Offline kagashe

  • Full Member
  • ***
  • Posts: 129
    • My Tryst with Linux
Re: Compiling pygtk-2,12,1 error headers not found.
« Reply #14 on: December 23, 2008, 07:54:09 AM »
Code: [Select]
$ sudo ln -s /usr/local/lib/libXrender.la /usr/lib
$ sudo ln -s /usr/local/lib/libX11.la /usr/lib

..but it might be better to try "export LDFLAGS=$LDFLAGS:/usr/local/lib" and then run ./configure again?
This results into error:
Quote
configure: error: C compiler cannot create executables.

kagashe