# configure: error: could not find Python headers



## PlatinumKing (Aug 31, 2009)

I rebuilded lang/python26 with PTH option, and have rebuilt Python 2.6 recursive ports. But devel/py-orbit cannot rebuild.


```
# make
===>   py26-orbit-2.24.0 depends on file: /usr/local/bin/python2.6 - found
===>   py26-orbit-2.24.0 depends on executable: gmake - found
===>   py26-orbit-2.24.0 depends on executable: pkg-config - found
===>   py26-orbit-2.24.0 depends on shared library: glib-2.0.0 - found
===>   py26-orbit-2.24.0 depends on shared library: IDL-2.0 - found
===>   py26-orbit-2.24.0 depends on shared library: ORBit-2.0 - found
===>  Configuring for py26-orbit-2.24.0
...
...
checking for headers required to compile python extensions... found
checking for python libraries... not found
configure: error: could not find Python headers
===>  Script "configure" failed unexpectedly.
Please run the gnomelogalyzer, available from
"http://www.freebsd.org/gnome/gnomelogalyzer.sh", which will diagnose the
problem and suggest a solution. If - and only if - the gnomelogalyzer cannot
solve the problem, report the build failure to the FreeBSD GNOME team at
[email]gnome@FreeBSD.org[/email], and attach (a)
"/usr/ports/devel/py-orbit/work/pyorbit-2.24.0/config.log", (b) the output
of the failed make command, and (c) the gnomelogalyzer output. Also, it might
be a good idea to provide an overview of all packages installed on your system
(i.e. an `ls /var/db/pkg`). Put your attachment up on any website,
copy-and-paste into [url]http://freebsd-gnome.pastebin.com[/url], or use send-pr(1) with
the attachment. Try to avoid sending any attachments to the mailing list
(gnome@FreeBSD.org), because attachments sent to FreeBSD mailing lists are
usually discarded by the mailing list software.
*** Error code 1

Stop in /usr/ports/devel/py-orbit.
```


----------



## joinison (Nov 3, 2009)

hello!!
I have the same problem with you!! did you solve it ? and how ?
  Thanks!!


----------



## LateNiteTV (Nov 3, 2009)

you can try to pkg_add it.


----------



## t0ken (Dec 12, 2009)

has anyone fixed this??


----------



## pchan (Dec 16, 2009)

Try rebuilding python from source: http://www.python.org/download/. That might work for you.


----------



## crsd (Dec 17, 2009)

pchan said:
			
		

> Try rebuilding python from source: http://www.python.org/download/. That might work for you.



That is just wrong.


----------



## jjthomas (Dec 25, 2009)

crsd said:
			
		

> That is just wrong.



How so?  I am having the same problem.

-JJ


----------



## crsd (Dec 25, 2009)

jjthomas said:
			
		

> How so?  I am having the same problem.
> 
> -JJ



Because he was suggesting to install something from source instead of fixing his python/something-else installation from ports.

Questions is - did you (and OP) updated your python from 2.5 to 2.6 and followed *all* instructions in /usr/ports/UPDATING?


----------



## zeiz (Dec 25, 2009)

I would try first to build py-orbit separately first:

```
# cd /usr/ports/devel/py-orbit ; make clean ; make install clean
```
or even like this:
`ls /var/db/pkg |grep py-orbit`
and if the package exists

```
# cd /usr/ports/devel/py-orbit ; make deinstall ; make clean ; make reinstall
```


----------



## jjthomas (Dec 26, 2009)

crsd said:
			
		

> Because he was suggesting to install something from source instead of fixing his python/something-else installation from ports.
> 
> Questions is - did you (and OP) updated your python from 2.5 to 2.6 and followed *all* instructions in /usr/ports/UPDATING?



It is a brand new installation.  I am installing FreeBSD on two computers.  One will be a server and the other my personal workstation.   The server I successfully installed the xfce desktop.  

The server had a couple of stop messages that I was able to resolve by changing the config of the failing port.

The desktop stopped (building with a gnome desktop, btw) with the same message the OP encountered.  I spent about 8 hours trying to get it resolved without any success.  I then rebuilt my desktop using packages.

I did try to update ports.  I got a message that it was current.  Given that this was a brand new install is that a good assumption, or did I miss a step.  I am installing FreeBSD 8.0.

If my desktop finishes and works the way I want it to, that will be fine.  If not I'll give ports another go.

-JJ


----------



## crsd (Dec 26, 2009)

Please file a PR then. send-pr(1) or use http://www.freebsd.org/send-pr.html


----------



## jjthomas (Dec 27, 2009)

I am filling on for somebody at work, so I'll give the ports installation another try.


----------



## didonk (Jan 2, 2010)

I have the same problem when i was compiling xorg at FreeBSD 7.2
I fix it by copying file pth.h from /usr/local/include/pth to /usr/local/include/python2.6


----------



## jjthomas (Jan 2, 2010)

I was able to get eveything to install.  I did install GhostScript8 before I installed xorg / gnome2.  I also used portmaster this go around.  

-JJ


----------



## DutchDaemon (Jan 2, 2010)

PlatinumKing, do you still have this problem, or can this topic be marked [solved]?


----------



## enderli (Jan 23, 2010)

*This way is worked....at FreeBSD8.0*



			
				didonk said:
			
		

> I have the same problem when i was compiling xorg at FreeBSD 7.2
> I fix it by copying file pth.h from /usr/local/include/pth to /usr/local/include/python2.6




```
cd /usr/local/include/python2.6
ln -s /usr/local/include/pth/pth.h
```


----------



## pgmrdlm (Apr 27, 2010)

*Thank you*

That worked for me also, I received that same error message installing xorg via ports on FreeBSD 8.0.


----------



## rassilon (Aug 17, 2010)

*Doesn't work if using GNU Pth*

This is a work around, not a solution. Basically, if you are using GNU Pth (PTH option on the lang/python26 "make config" screen), then the pth.h file isn't found because it isn't included in the python headers. Because the GNU Pth option is off by default, most people don't run into the issue as it then uses a version included in python.

Thus, you can work around the problem by either copying or symlinking the real pth.h file into the python includes or reinstalling python without the GNU Pth option. However, the best solution would probably be to have the configure script check if devel/pth is installed.


----------



## Solaris (Oct 15, 2010)

This problem still exist on 8.1 release!, temporary workaround by enderli work fine .


----------



## Ashandy (Oct 25, 2011)

Try 
`ln -s /usr/local/lib/pth/libpth.a /usr/local/lib/`
`ln -s /usr/local/include/pth/pth.h /usr/local/include/python2.6`

Or rebuild python without PTH support.


----------



## Yaffle (Dec 5, 2012)

Solaris said:
			
		

> This problem still exist on 8.1 release!, temporary workaround by enderli work fine .



Again in 9.0....


----------



## Hawk (Mar 3, 2013)

And 9.1.


----------



## Deever (Apr 6, 2013)

And 10-CURRENT.


----------

