MacBook install

I am unable to install matplot lib on my new laptop. It is an intel based Mac. Stepping throught the install I found that build_py works but build_ext breaks with what looks like a couple of link errors. Any help would be appreciated.

Ian

hostname:~/src/matplotlib-0.87 mennis$ sudo python setup.py build_ext
GTK requires pygtk
GTKAgg requires pygtk
running build_ext
building 'matplotlib.backends._tkagg' extension
gcc options: '-fno-strict-aliasing -Wno-long-double -no-cpp-precomp -mno-fused-madd -fPIC -fno-common -dynamic -DNDEBUG -g -O3 -Wall -Wstrict-prototypes'
compile options: '-I/System/Library/Frameworks/Tcl.framework/Headers -I/System/Library/Frameworks/Tcl.framework/Versions/Current/PrivateHeaders -I/System/Library/Frameworks/Tk.framework/Headers -I/System/Library/Frameworks/Tk.framework/Versions/Current/PrivateHeaders -I/usr/local/include -I/usr/include -I/sw/include -I. -Isrc -Iswig -Iagg23/include -I. -I/usr/local/include -I/usr/include -I/sw/include -I. -I/System/Library/Frameworks/Tcl.framework/Headers/freetype2 -I/System/Library/Frameworks/Tcl.framework/Versions/Current/PrivateHeaders/freetype2 -I/System/Library/Frameworks/Tk.framework/Headers/freetype2 -I/System/Library/Frameworks/Tk.framework/Versions/Current/PrivateHeaders/freetype2 -I/usr/local/include/freetype2 -I/usr/include/freetype2 -I/sw/include/freetype2 -I./freetype2 -Isrc/freetype2 -Iswig/freetype2 -Iagg23/include/freetype2 -I./freetype2 -I/usr/local/include/freetype2 -I/usr/include/freetype2 -I/sw/include/freetype2 -I./freetype2 -I/Library/Frameworks/Python.framework/Versions/2.4/include/python2.4 -c'
extra options: '-framework Tcl -framework Tk'
c++ -bundle -undefined dynamic_lookup build/temp.darwin-8.5.2-i386-2.4/src/_tkagg.o build/temp.darwin-8.5.2-i386-2.4/CXX/cxx_extensions.o build/temp.darwin-8.5.2-i386-2.4/CXX/cxxsupport.o build/temp.darwin-8.5.2-i386-2.4/CXX/IndirectPythonInterface.o build/temp.darwin-8.5.2-i386-2.4/CXX/cxxextensions.o -L/usr/local/lib -L/usr/lib -L/sw/lib -L/usr/local/lib -L/usr/lib -L/sw/lib -lpng -lz -lstdc++ -lm -lfreetype -lz -lstdc++ -lm -o build/lib.darwin-8.5.2-i386-2.4/matplotlib/backends/_tkagg.so -framework Tcl -framework Tk
/usr/bin/ld: can't locate file for: -lpng
collect2: ld returned 1 exit status
/usr/bin/ld: can't locate file for: -lpng
collect2: ld returned 1 exit status
error: Command "c++ -bundle -undefined dynamic_lookup build/temp.darwin-8.5.2-i386-2.4/src/_tkagg.o build/temp.darwin-8.5.2-i386-2.4/CXX/cxx_extensions.o build/temp.darwin-8.5.2-i386-2.4/CXX/cxxsupport.o build/temp.darwin-8.5.2-i386-2.4/CXX/IndirectPythonInterface.o build/temp.darwin-8.5.2-i386-2.4/CXX/cxxextensions.o -L/usr/local/lib -L/usr/lib -L/sw/lib -L/usr/local/lib -L/usr/lib -L/sw/lib -lpng -lz -lstdc++ -lm -lfreetype -lz -lstdc++ -lm -o build/lib.darwin-8.5.2-i386-2.4/matplotlib/backends/_tkagg.so -framework Tcl -framework Tk" failed with exit status 1
hostname:~/src/matplotlib-0.87 mennis$

I am unable to install matplot lib on my new laptop. It is an intel
based Mac. Stepping throught the install I found that build_py works
but build_ext breaks with what looks like a couple of link errors.
Any help would be appreciated.

Ian

hostname:~/src/matplotlib-0.87 mennis$ sudo python setup.py build_ext
GTK requires pygtk
GTKAgg requires pygtk
running build_ext
building 'matplotlib.backends._tkagg' extension
gcc options: '-fno-strict-aliasing -Wno-long-double -no-cpp-precomp -
mno-fused-madd -fPIC -fno-common -dynamic -DNDEBUG -g -O3 -Wall -
Wstrict-prototypes'
compile options: '-I/System/Library/Frameworks/Tcl.framework/Headers -
I/System/Library/Frameworks/Tcl.framework/Versions/Current/
PrivateHeaders -I/System/Library/Frameworks/Tk.framework/Headers -I/
System/Library/Frameworks/Tk.framework/Versions/Current/
PrivateHeaders -I/usr/local/include -I/usr/include -I/sw/include -I. -
Isrc -Iswig -Iagg23/include -I. -I/usr/local/include -I/usr/include -
I/sw/include -I. -I/System/Library/Frameworks/Tcl.framework/Headers/
freetype2 -I/System/Library/Frameworks/Tcl.framework/Versions/Current/
PrivateHeaders/freetype2 -I/System/Library/Frameworks/Tk.framework/
Headers/freetype2 -I/System/Library/Frameworks/Tk.framework/Versions/
Current/PrivateHeaders/freetype2 -I/usr/local/include/freetype2 -I/
usr/include/freetype2 -I/sw/include/freetype2 -I./freetype2 -Isrc/
freetype2 -Iswig/freetype2 -Iagg23/include/freetype2 -I./freetype2 -I/
usr/local/include/freetype2 -I/usr/include/freetype2 -I/sw/include/
freetype2 -I./freetype2 -I/Library/Frameworks/Python.framework/
Versions/2.4/include/python2.4 -c'
extra options: '-framework Tcl -framework Tk'
c++ -bundle -undefined dynamic_lookup build/temp.darwin-8.5.2-
i386-2.4/src/_tkagg.o build/temp.darwin-8.5.2-i386-2.4/CXX/
cxx_extensions.o build/temp.darwin-8.5.2-i386-2.4/CXX/cxxsupport.o
build/temp.darwin-8.5.2-i386-2.4/CXX/IndirectPythonInterface.o build/
temp.darwin-8.5.2-i386-2.4/CXX/cxxextensions.o -L/usr/local/lib -L/
usr/lib -L/sw/lib -L/usr/local/lib -L/usr/lib -L/sw/lib -lpng -lz -
lstdc++ -lm -lfreetype -lz -lstdc++ -lm -o build/lib.darwin-8.5.2-
i386-2.4/matplotlib/backends/_tkagg.so -framework Tcl -framework Tk
/usr/bin/ld: can't locate file for: -lpng
collect2: ld returned 1 exit status

is it not simply, that you are missing a devel png library?

···

Le Vendredi 10 Mars 2006 13:47, Michaelian Ennis a écrit :

/usr/bin/ld: can't locate file for: -lpng
collect2: ld returned 1 exit status
error: Command "c++ -bundle -undefined dynamic_lookup build/
temp.darwin-8.5.2-i386-2.4/src/_tkagg.o build/temp.darwin-8.5.2-
i386-2.4/CXX/cxx_extensions.o build/temp.darwin-8.5.2-i386-2.4/CXX/
cxxsupport.o build/temp.darwin-8.5.2-i386-2.4/CXX/
IndirectPythonInterface.o build/temp.darwin-8.5.2-i386-2.4/CXX/
cxxextensions.o -L/usr/local/lib -L/usr/lib -L/sw/lib -L/usr/local/
lib -L/usr/lib -L/sw/lib -lpng -lz -lstdc++ -lm -lfreetype -lz -lstdc+
+ -lm -o build/lib.darwin-8.5.2-i386-2.4/matplotlib/backends/
_tkagg.so -framework Tcl -framework Tk" failed with exit status 1
hostname:~/src/matplotlib-0.87 mennis$

I got matplotlib working on my MacBook. It was surprisingly easy.

NumPy installs right away (scipy is a different issue -- between gcc4.0 only and no g77 support yet...)

I installed universal binaries of png, freetype, and TeX using the i-Installer. This put things in the right place, and maplotlib found them and liked them.

I also installed my own version of python 2.4 -- the one that ships with the Mac has no readline, and I like readline quite a bit.. MPL seemed to install fine with both python versions, though, so that is not a big deal either way.

Finally, TkAqua is pre-installed on the MacBooks, and seems to work well with MPL. It is recognized by the presintalled MacPython (2.3), and was also recognized by my own install of python 2.4 (into /usr/local).

-Rob

···

-----
Rob Hetland, Assistant Professor
Dept of Oceanography, Texas A&M University
p: 979-458-0096, f: 979-845-6331
e: hetland@...760..., w: http://pong.tamu.edu

Robert Hetland wrote:

and was also recognized by my own install of python 2.4 (into /usr/local).

Rob,

Is there a reason you didn't try the new Universal Framework Build of Python 2.4.2? Or did you not know about it? I'd like to get as many packages as possible working with that. (and built and contributed to pythonmac.org)

See this post from python-mac list:

"""
I've spent some time on an 10.3 box and updated the installer as a
result of that.

The universal python installer should now be complete, except for
remaining bugs obviously. I have however not tested it on an Intel
box yet.

* The installer works on 10.3 and 10.4
* regrtest -uall passes on 10.3/ppc, 10.4/ppc
* compiling extensions works on 10.3
* the existing (non-universal) wxPython installer installs fine and
results in a working wxPython installation (on PPC only of course) on
10.3, which indicates that existing C++ extensions should work just
fine with the universal build
* IDLE works, including the local documentation
* Profile updater works

New from the previous release:
* Locally installed documentation can be accessed from IDLE
* Minor changes to the profile updater, and it is now also installed
in /Application/MacPython 2.4
* Building extensions works on 10.3
* Various minor bugfixes

There is one minor issue: the curses module doesn't work on OSX 10.3,
the extension is linked to a version of libncurses that isn't
available on 10.3.

Please test this version and let me know of the results (both
negative and positive). Unless major issues turn up we can do a
golden release this weekend. That release will NOT have new icons, we
can do a new release with updated icons later on.

The installer is in the Public folder of my iDisk: http://
homepage.mac.com/ronaldoussoren/.Public/Universal%20MacPython%
202.4.2.dmg
"""

-Chris

···

--
Christopher Barker, Ph.D.
Oceanographer
                                         
NOAA/OR&R/HAZMAT (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception

Chris.Barker@...259...

Indeed, I did not know about it.

When I checked a while back, I did not notice any universal builds. I am pretty happy with my home rolled build. Are there any special reasons to put python in the /Library/Frameworks directory? I imagine there are, and I’m just not clued in enough to know why…

Thanks for the tip,

-Rob.

···

On Mar 10, 2006, at 3:00 PM, Christopher Barker wrote:

Or did you not know about it?


Rob Hetland, Assistant Professor

Dept of Oceanography, Texas A&M University

p: 979-458-0096, f: 979-845-6331

e: hetland@…760…, w: http://pong.tamu.edu

Robert Hetland wrote:

Indeed, I did not know about it.

When I checked a while back, I did not notice any universal builds.

It's very new, but has gotten a lot of discussion on the python-mac list. That's a very good list to subscribe to if your using Python on a Macintosh.

am pretty happy with my home rolled build. Are there any special reasons to put python in the /Library/Frameworks directory? I imagine
there are, and I'm just not clued in enough to know why..

Honestly, I'm not that clued in to what exactly the advantage is a framework -- but I do know it's more than just where it happens to live.

One advantage to the framework build is that you can use py2App to make a .app bundle of your program -- I don't know if it works with a standard unix-style build.

By the way, you can build it yourself as a Framework with a flag like --enable-framework or something like that.

The current goal of the macpython crowd is to establish a more or less "standard" build -- the universal framework build, and then we can populate pythonmac.org with pre-build extension packages for it.

This will be a big help to folks (unlike yourself) that wouldn't dream of building python from source.

-Chris

···

--
Christopher Barker, Ph.D.
Oceanographer
                                         
NOAA/OR&R/HAZMAT (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception

Chris.Barker@...259...