[Pythonmac-SIG] Still trying to get matplotlib to compile

Kenneth McDonald kenneth.m.mcdonald at sbcglobal.net
Thu Jul 15 00:07:28 CEST 2004


Many thanks to Bob Ippolito for his help--I've included my original
message and his reply at the end of this message, for reference.

After reading Bob's message, I looked into /usr/lib and found that while
it contained a tclConfig.sh, there was no tkConfig.sh. A search of the
file system revealed a tkConfig.sh in /Library/Framewords/Tk.framework, 
so
I copied it there.

While I suspect this was a Good Thing To Do, it still hasn't solved
the problem of matplotlib's setup.py not being able to find the tcl/tk
headers. Here's my attempt at building and the resultant message:

ken% python setup.py build
GTKAgg requires pygtk
cannot find tcl/tk headers. giving up.

The message about "GTKAgg" is expected and should be ignored. Attempting
a "python setup.py -v build" gave exactly the same error messages. 
Unfortunately
the error message about the header, while to the point, isn't terribly 
helpful :-)

matplotlib is packaged using distutil, and presumably distutil isn't 
getting
the info it needs to figure out where the headers are. I've started 
reading
about distutil, but am a novice at it (and it's a fairly involved 
package, as
well), so if others could offer suggestions as to how to track down/fix 
this
problem, it would be a real help.

Cheers,
Ken

>> I'm attempting to compile matplotlib, and get messages saying that
>> it can't find the headers for Tcl/Tk. They exist, they just happen to
>> be in the Frameworks directories for Tcl and for Tk. I know I can
>> get this to work by hacking (setting up path variables, putting 
>> symbolic
>> links in directories, or some such), but aside from the fact that 
>> that's
>> a pain and ugly, it doesn't solve the more general problem; if header
>> files are supposed to be in Frameworks directories (for example, I
>> found my Tk header files in /Library/Frameworks/Tk.framework/Headers),
>> what is the best way to set up OS X so that they will be available to 
>> link
>> against? Note that I don't know that these headers are supposed to be
>> there; they just are, and for the time being, I'm assuming that the
>> person who put together Tk.Framework knew what they were doing.
>
> Short answer:  Whatever you're trying to build is DOING IT WRONG by 
> not using tclConfig.sh (they should allow the user to choose which 
> one, but should default to /usr/lib/tclConfig.sh I guess).  This is 
> equivalent to not using distutils.  It probably won't be a problem in 
> the Mac OS X future however, because...
>
> Apple's latest strategy for unixy stuff (at least for Python) seems to 
> be a hybrid approach that should please almost anyone:
> 	(1) the actual dylib lives in /usr/lib and has a mach-o id pointing 
> to /usr/lib
> 	(2) the framework has symlinks to /usr/lib for its dylib
> 	(3) the headers live in the framework
> 	(4) /usr/include has appropriate symlinks into the framework
>
> [I can say this without breaking NDA because Apple has publicly 
> released their sources for Python in Darwin 8.0.0b1]



More information about the Pythonmac-SIG mailing list