[Pythonmac-SIG] NumPy in Apple Python 2.2

Marcus Mendenhall marcus.h.mendenhall@vanderbilt.edu
Mon May 19 17:08:21 EDT 2003


On a more serious note, anyone know where I can find a NumPy which will 
work with Jag's built-in Python? I want to run some scripts from the 
shell and i was hoping to get NumPy and/or SciPy happening with Apple's 
built-in Python.
>
> I also have Jack's Python 2.3a2 (#1, Mar  3 2003, 18:50:46) installed 
> (perhaps this is out of date too). Is there a way to invoke that build 
> from the shell and use that version of python to run scripts? Has 
> anyone made a Numeric package that works with Jack's Python?
>
> I can't wait till we have one unified Unix/Mac Python. This is so 
> messy and confusing. I have no idea what I am doing. It has gotten so 
> bad that i sometimes have been tempted to boot OS 9 to hack Python.
>
> -kevin--
>
>

NumPy  _almost_ works out-of-the-box with Apple's Jag python.  There is 
an error in Apple's configuration file for python that breaks it (and 
any other distutils based install), but which is easy to fix.

If you look in /usr/lib/python2.2/config/Makefile, you will see
DEFS=           -DHAVE_CONFIG_H
CFLAGS=         $(OPT)
CPPFLAGS=       -I. -I$(srcdir)/Include $(DEFS)
LDFLAGS=        -arch ppc            -L/sw/lib/
LDLAST=
SGI_ABI=
CCSHARED=
LINKFORSHARED=  -u __dummy -u _PyMac_Error -framework System -framework 
CoreServices -framework Foundation
# Extra C flags added for building the interpreter object files.

except that on the line LDFLAGS= you will see a -arch x86
This causes it to try to link for x86, which doesn't work (obviously).  
If you fix it to look like the lines I have above, and then type
/usr/bin/python setup.py install

in the NumPy directory, everything should just work.

I have no idea how this error leaked into the Apple python distro, 
since I don't think python could have been built with this in the file.

Marcus Mendenhall





More information about the Pythonmac-SIG mailing list