problems building/installing

I'm embarrassed to ask that I'm having trouble building/installing matplotlib on an intel Mac.

The version at http://matplotlib.sourceforge.net/ wants to give me an .egg file for my Mac, and I have yet to figure out how to load and install .egg files. (How come python is such a mess?)

So I tried to install with darwinports. Darwinports proceeded to upgrade my python from 2.4 to 2.5 (thanks!) and then gave me an error installing numeric because the fortran compiler wouldn't build or something.

So I manually installed numeric (I don't need fortran support) and manually downloaded matplotlib to install with setup.py. But I'm getting this error:

building 'matplotlib.backends._tkagg' extension
g++ -arch i386 -arch ppc -isysroot /Developer/SDKs/MacOSX10.4u.sdk -g -bundle -undefined dynamic_lookup build/temp.macosx-10.3-fat-2.5/src/_tkagg.o build/temp.macosx-10.3-fat-2.5/CXX/cxx_extensions.o build/temp.macosx-10.3-fat-2.5/CXX/cxxsupport.o build/temp.macosx-10.3-fat-2.5/CXX/IndirectPythonInterface.o build/temp.macosx-10.3-fat-2.5/CXX/cxxextensions.o -L/usr/local/lib -L/usr/lib -L/usr/local/lib -L/usr/lib -lpng -lz -lstdc++ -lm -lfreetype -lz -lstdc++ -lm -o build/lib.macosx-10.3-fat-2.5/matplotlib/backends/_tkagg.so -framework Tcl -framework Tk
/usr/bin/ld: for/usr/bin/ld: for architecture ppc
/usr/bin/ld: can't locate file for: -lpng
collect2: ld returned 1 exit status
architecture i386
/usr/bin/ld: can't locate file for: -lpng
collect2: ld returned 1 exit status
lipo: can't open input file: /var/tmp//ccl92wxW.out (No such file or directory)
error: command 'g++' failed with exit status 1
Computer:/Users/simsong/Desktop/matplotlib-0.90.0 root#

This basically says that it can't build the universal version on my mac because I only have intel binaries for libpng, and not universal binaries.

I don't need universal binaries; I'm only running on intel.

I'd rather not go down this path, it turns out. It would be a lot easier for me just to download binaries.

What I would like to know is:

1. What is the preferred way for installing matplotlib on Mac at this point?
2. How do I install an EGG file?

Thanks!

For detailed instructions about eggs see:
http://peak.telecommunity.com/DevCenter/EasyInstall

Quick instructions:
Download:
http://peak.telecommunity.com/dist/ez_setup.py
and run it.

then run
easy_install matplotlib
or
easy_install /path/to/matplotlib-xxx.egg

HTH,
Edin

···

On 4/4/07, Simson Garfinkel <simsong@...1340...> wrote:

2. How do I install an EGG file?

Alas, tried the easy_install matplotlib. It downloaded and installed matplotlib, but didn't install wx, so I got this error:

>>> from pylab import *;
Traceback (most recent call last):
   File "<stdin>", line 1, in <module>
   File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/matplotlib-0.90.0-py2.5-macosx-10.4-fat.egg/pylab.py", line 1, in <module>
     from matplotlib.pylab import *
   File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/matplotlib-0.90.0-py2.5-macosx-10.4-fat.egg/matplotlib/pylab.py", line 222, in <module>
     new_figure_manager, draw_if_interactive, show = pylab_setup()
   File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/matplotlib-0.90.0-py2.5-macosx-10.4-fat.egg/matplotlib/backends/__init__.py", line 24, in pylab_setup
     globals(),locals(),[backend_name])
   File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/matplotlib-0.90.0-py2.5-macosx-10.4-fat.egg/matplotlib/backends/backend_wxagg.py", line 19, in <module>
     import wx
ImportError: No module named wx
>>>

When I tried to use easy_install to install wxPython, I got this:

Computer:/Users/simsong root# easy_install wxPython
Searching for wxPython
Reading http://cheeseshop.python.org/pypi/wxPython/
Reading http://wxPython.org/
Reading http://wxPython.org/download.php
Reading http://cheeseshop.python.org/pypi/wxPython/2.6.3.2
Best match: wxPython src-2.8.3.0
Downloading http://prdownloads.sourceforge.net/wxpython/wxPython-src-2.8.3.0.tar.bz2
Processing wxPython-src-2.8.3.0.tar.bz2
error: Couldn't find a setup script in /tmp/easy_install-UB-WlK/wxPython-src-2.8.3.0.tar.bz2
Computer:/Users/simsong root#

Why do we make this so hard?

The wyPython page for Mac says:

···

========

Mac OS X

wxPython needs a special Mac OS X-specific build of Python, called a Framework build, in order to work. Panther and Tiger include a Framework build of Python 2.3, but on Jaguar you'll need to get the MacPython installer from Jack's MacPython page.

(I really can't keep track of all these cat names. )

Then I need to choose one of 8 different versions to install, dependin gon whether I am using py2.3, 2.4 or 2.5, and whether I want unicode or ansi, and whether I want PPC or Universal.

But I finally got it installed. Thanks.

On Apr 4, 2007, at 7:38 AM, Edin Salkovic wrote:

On 4/4/07, Simson Garfinkel <simsong@...1340...> wrote:

2. How do I install an EGG file?

For detailed instructions about eggs see:
http://peak.telecommunity.com/DevCenter/EasyInstall

Quick instructions:
Download:
http://peak.telecommunity.com/dist/ez_setup.py
and run it.

then run
easy_install matplotlib
or
easy_install /path/to/matplotlib-xxx.egg

HTH,
Edin

My understanding is that currently the best way to get all these packages (wxpython, matplotlib, numpy, etc) running together on os x is via these packages:
http://pythonmac.org/packages/

at least, I can say for sure that the 2.5 builds worked without a hitch for me. Its a little tough right now that os x doesn't have one python install to rule them all. Instead, there are about 5 (not an actual count) ways to do it, most with gotchas.
tim

Simson Garfinkel wrote:

···

Alas, tried the easy_install matplotlib. It downloaded and installed matplotlib, but didn't install wx, so I got this error:

>>> from pylab import *;
Traceback (most recent call last):
   File "<stdin>", line 1, in <module>
   File "/Library/Frameworks/Python.framework/Versions/2.5/lib/ python2.5/site-packages/matplotlib-0.90.0-py2.5-macosx-10.4-fat.egg/ pylab.py", line 1, in <module>
     from matplotlib.pylab import *
   File "/Library/Frameworks/Python.framework/Versions/2.5/lib/ python2.5/site-packages/matplotlib-0.90.0-py2.5-macosx-10.4-fat.egg/ matplotlib/pylab.py", line 222, in <module>
     new_figure_manager, draw_if_interactive, show = pylab_setup()
   File "/Library/Frameworks/Python.framework/Versions/2.5/lib/ python2.5/site-packages/matplotlib-0.90.0-py2.5-macosx-10.4-fat.egg/ matplotlib/backends/__init__.py", line 24, in pylab_setup
     globals(),locals(),[backend_name])
   File "/Library/Frameworks/Python.framework/Versions/2.5/lib/ python2.5/site-packages/matplotlib-0.90.0-py2.5-macosx-10.4-fat.egg/ matplotlib/backends/backend_wxagg.py", line 19, in <module>
     import wx
ImportError: No module named wx
>>>

When I tried to use easy_install to install wxPython, I got this:

Computer:/Users/simsong root# easy_install wxPython
Searching for wxPython
Reading http://cheeseshop.python.org/pypi/wxPython/
Reading http://wxPython.org/
Reading http://wxPython.org/download.php
Reading http://cheeseshop.python.org/pypi/wxPython/2.6.3.2
Best match: wxPython src-2.8.3.0
Downloading http://prdownloads.sourceforge.net/wxpython/wxPython- src-2.8.3.0.tar.bz2
Processing wxPython-src-2.8.3.0.tar.bz2
error: Couldn't find a setup script in /tmp/easy_install-UB-WlK/ wxPython-src-2.8.3.0.tar.bz2
Computer:/Users/simsong root#

Why do we make this so hard?

The wyPython page for Mac says:

========

Mac OS X

wxPython needs a special Mac OS X-specific build of Python, called a Framework build, in order to work. Panther and Tiger include a Framework build of Python 2.3, but on Jaguar you'll need to get the MacPython installer from Jack's MacPython page.

(I really can't keep track of all these cat names. )

Then I need to choose one of 8 different versions to install, dependin gon whether I am using py2.3, 2.4 or 2.5, and whether I want unicode or ansi, and whether I want PPC or Universal.

But I finally got it installed. Thanks.

On Apr 4, 2007, at 7:38 AM, Edin Salkovic wrote:

On 4/4/07, Simson Garfinkel <simsong@...1340...> wrote:
    

2. How do I install an EGG file?
      

For detailed instructions about eggs see:
http://peak.telecommunity.com/DevCenter/EasyInstall

Quick instructions:
Download:
http://peak.telecommunity.com/dist/ez_setup.py
and run it.

then run
easy_install matplotlib
or
easy_install /path/to/matplotlib-xxx.egg

HTH,
Edin

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Tim Hirzel wrote:

Its a little tough right now that os x doesn't have one python
install to rule them all.

Yes it does.

  http://www.python.org/download/

···

--
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
that is made terrible by our own mad attempt to interpret it as though it had
an underlying truth."
  -- Umberto Eco

Simson Garfinkel wrote:

I'm embarrassed to ask that I'm having trouble building/installing matplotlib on an intel Mac.

Don't be embarassed -- it's really pretty hard!

All the various pythons (Universal, fink, darwinports, etc) for OS-X confuse things a lot, but I think you'll get the best support if you stick with the "official" framework Universal build:

http://www.python.org/download/

You can also get it from:

http://www.pythonmac.org/packages/py25-fat/index.html

The cool thing about that site is that you can get a bunch of pr-built compatible packages from there also.

Unfortunately, the matplotlib there right now doesn't appear to work with the latest wxPython. I'm not sure which wxPython version it is built against, but it crashed for me when used with wxPython2.8.3

The good news is, as I understand it, is the Ken McIvor patched the most recent MPL to use wxPython 2.8b features that allow you to build MPL without linking to wxPython.

Hopefully someone will do a build that works with wxPython2.8.3 and put it up on the pythonmac site soon. I may even do it, but I haven't needed to for a while, so I don't have it all set up at this point.

If you're going to built it yourself, still use the pythonmac packages for everything else, you'll be glad you did.

-Chris

oops, my bad. thanks for the correction.
t

Robert Kern wrote:

···

Tim Hirzel wrote:
  

Its a little tough right now that os x doesn't have one python install to rule them all.
    
Yes it does.

  http://www.python.org/download/

Hello Simon-

I have experimented with every conceivable python/numpy/mpl
permutation on mac os and I will second Chris Barker's recommendation.
Use the pythonmac.org packages with the wx backend. Choose whichever
version of wx and python that is best supported my the mpl version.

I use mpl v 0.87, wx 2.6. and python 2.4 on my ppc mac.

-stephen

···

On 4/5/07, Christopher Barker <Chris.Barker@...259...> wrote:

Simson Garfinkel wrote:
> I'm embarrassed to ask that I'm having trouble building/installing
> matplotlib on an intel Mac.

Don't be embarassed -- it's really pretty hard!

All the various pythons (Universal, fink, darwinports, etc) for OS-X
confuse things a lot, but I think you'll get the best support if you
stick with the "official" framework Universal build:

http://www.python.org/download/

You can also get it from:

http://www.pythonmac.org/packages/py25-fat/index.html

The cool thing about that site is that you can get a bunch of pr-built
compatible packages from there also.

Unfortunately, the matplotlib there right now doesn't appear to work
with the latest wxPython. I'm not sure which wxPython version it is
built against, but it crashed for me when used with wxPython2.8.3

The good news is, as I understand it, is the Ken McIvor patched the most
recent MPL to use wxPython 2.8b features that allow you to build MPL
without linking to wxPython.

Hopefully someone will do a build that works with wxPython2.8.3 and put
it up on the pythonmac site soon. I may even do it, but I haven't needed
to for a while, so I don't have it all set up at this point.

If you're going to built it yourself, still use the pythonmac packages
for everything else, you'll be glad you did.

-Chris

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Stephen Uhlhorn wrote:

I have experimented with every conceivable python/numpy/mpl
permutation on mac os and I will second Chris Barker's recommendation.
Use the pythonmac.org packages with the wx backend. Choose whichever
version of wx and python that is best supported my the mpl version.

I use mpl v 0.87, wx 2.6. and python 2.4 on my ppc mac.

I think mpl 9.0, python 2.5 and wx 2.6 will work OK too. I'm working right now on getting a version that will work well with wxPython2.8 -- but I'm not there yet.

-Chris

···

--
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception

Chris.Barker@...259...