[Pythonmac-SIG] Questions concerning OS X, Python, Tk, libraries, fink, and maybe some other things too...

Kenneth McDonald kmmcdonald at wisc.edu
Sun Apr 18 23:40:00 EDT 2004


The Problem
-----------------

OK, sorry for the broad scope of this question, but there are so many  
things
I'm _possibly_ doing wrong that it's hard to narrow it down :-)

I am currently trying to get two Python/Tk related things working:

1) matplotlib with TkAgg, see  
http://matplotlib.sourceforge.net/backends.html, and
2) Fred Lundh's Tkinter3000

After a number of days of frustration, puzzling over gcc books, etc, I  
have
now advanced the installation of each of these packages to the point  
where
they are theoretically installed, and when I try to run either, the  
following happens:

	# ...my command invoking matplotlib or Tkinter3000...

	Fatal Python error: Interpreter not initialized (version mismatch?)
	Abort

Trust me, this is real progress over a few days ago! :-)


What I've Tried
--------------------

To start off, here is what I've done to try to get things installed:

1) Set up the following environment variables, so that gcc
can find libraries and sources it needs:

setenv CPATH  
/Library/Frameworks/Python.framework/Headers:/Library/Frameworks/ 
Tk.framework/Headers:/Library/Frameworks/Tcl.framework/Headers:/usr/ 
local/include
setenv LD_LIBRARY_PATH  
/Library/Frameworks/Python.framework:/Library/Frameworks/Tk.framework:/ 
Library/Frameworks/Tcl.framework:/usr/local/lib
setenv LIBRARY_PATH  
/Library/Frameworks/Python.framework:/Library/Frameworks/Tk.framework:/ 
Library/Frameworks/Tcl.framework:/usr/local/lib

1a) Copied libtk8.4.a from somewhere (I can't even remember
from where) to the Tk Frameworks folder, so it would be on the
library path. This was probably a Bad Thing, but I didn't know
what else to do, and hey, things finally compiled! (Too bad they
didn't work.)

2) Set up a /usr/local directory, and to it, copied a bunch of stuff
from /sw/bin (which was installed using fink, and I gotta say,
fink having its own special directory structure is a major PITA.
Is there a way to get fink to use the standard UNIX structure?)

3) Installed a couple of other things (notably freetype2) manually.

Doing the above allowed compilation and installation to complete,
but as the Fatal Python error indicates, things are not quite
working...


Status of my System
----------------------------

Currently, I have python and Tkinter using AquaTclTk installed and
running on my system. By doing 'which python', following links,
etc., I believe that my one and only python is the one in the
Frameworks directory. (Well, there is another in a Jython directory,
but I don't believe that is interfering with anything.) I'm running
the most recent OS X 10.3


Questions
--------------

Aside from the obvious (how do I get it working!?), I was wondering
if people would give suggestions on the following:

1) Is Fink worth using? So far, I've found that its use of a nonstandard
directory structure causes more harm than good. Any suggestions
for making things less painful?

2) How should I organize my libraries? Should I maintain copies in
both a UNIX-style directory structure and (where applicable) in
a Frameworks structure, should I hand-configure the appropriate
paths to include relevant Frameworks directories, should I create
links, what?

3) What the heck is a .dylib and how does it differ from a .so, _or_,
should I care?

4) If I'm trying to compile things that rely on Tk, does the fact that
I'm using AquaTk mean I have to take special steps? (Things like
BLT obviously cause problems, but my understanding is that BLT
uses some X11-specific calls that haven't yet been implemented
in whatever the smart AquaTclTk people are doing.)


Many thanks for any words of wisdom. I feel like I'm tantalizingly
close to getting this working, and only a few more months of
effort should have it! :-)

Thanks,
Ken McDonald




More information about the Pythonmac-SIG mailing list