Mac OSX summary

Hi all,

Recently, a sizable thread accrued focused on different installation problems with matplotlib on Mac OSX. I largely ignored the thread since I work on a Linux machine at work and had a windows machine at home. Last week I pitched the Windows machine out the window and went to the store to buy a Mac.

I don't want to abuse the good nature of the people on this list but I was wondering if someone might have a pointer for a gentle intro to Python on the Mac. If there is a good place to get some background I might be able to avoid the standard newbie questions. For example I dutifully installed Fink and have been using it to install some Python packages. However I notice that the Python installation from fink seems to be different than Python that comes with OSX Panther (/Library/Python I think). I always hated having two versions of Python on windows (the windows native port and the cygwin python) but I saw no way around it. Should I anticipate having two python installations on the mac as well?

I guess what I'm asking for is not details on installation procedures but rather a couple of comments on "best practices" from some of the pros out there.

My goal would be to have a working python/numeric/numarry/ipython/matplotlib installation in the place that is easiest to maintain. I'm not a bleeding edge sort of user however...

Thanks for any comments...
Derrick

Derrick Snowden wrote:

Hi all,

Recently, a sizable thread accrued focused on different installation problems with matplotlib on Mac OSX. I largely ignored the thread since I work on a Linux machine at work and had a windows machine at home. Last week I pitched the Windows machine out the window and went to the store to buy a Mac.
I don't want to abuse the good nature of the people on this list but I was wondering if someone might have a pointer for a gentle intro to Python on the Mac. If there is a good place to get some background I might be able to avoid the standard newbie questions. For example I dutifully installed Fink and have been using it to install some Python packages. However I notice that the Python installation from fink seems to be different than Python that comes with OSX Panther (/Library/Python I think). I always hated having two versions of Python on windows (the windows native port and the cygwin python) but I saw no way around it. Should I anticipate having two python installations on the mac as well?

Derrick: I'm the fink maintainer for the python and matplotlib packages, so let me explain the logic here. The fink python is a unix-build, and is intended primarily as a more 'unix-friendly'alternative to the Apple provided framework build. For example, it allows developers to test both aqua-native and X11 versions of their software on the same box (by running their programs with fink python and Apple python). You can also run the gtk-agg backend with the fink version of python+matplotlib, which you can't with Apple python+matplotlib. I myself prefer the gtk-agg backend (it's the most actively maintained and updated), so that's why I use the fink matplotlib.

I guess what I'm asking for is not details on installation procedures but rather a couple of comments on "best practices" from some of the pros out there.

My goal would be to have a working python/numeric/numarry/ipython/matplotlib installation in the place that is easiest to maintain. I'm not a bleeding edge sort of user however...

'fink install matplotlib-py24 ipython-py24' will get you all those packages in one shot with fink.

-Jeff

···

--
Jeffrey S. Whitaker Phone : (303)497-6313
Meteorologist FAX : (303)497-6449
NOAA/OAR/CDC R/CDC1 Email : Jeffrey.S.Whitaker@...259...
325 Broadway Office : Skaggs Research Cntr 1D-124
Boulder, CO, USA 80303-3328 Web : http://tinyurl.com/5telg

Derrick,

I would put a slightly different emphasis on what Jeff said.
Matplotlib works just fine with MacPython. You'll need the Apple
developer's tools and to build matplotlib with the usual
'sudo python setup.py install'.

That's not to say that the effort of making a matplotlib package
for Fink is not worthwhile: it is. But you do not *have* to use
Fink's python to use matplotlib.

Like Jeff said, MacPython can't use GTk (I think), while Fink's
python can. Well, I haven't tried to get GTk to work. For GUI
toolkits, WX works and Tk mostly works with MacPython. Of
course, Numeric, numarray, and ipython work fine too.

Cheers,

--Matt

My 2 cents:

I also dislike having two pythons installed, and I develop pretty much everything with the bundled apple framework. This also makes it easier come dependency time when moving your work to another mac.

numeric/numarry/ipython are cake to install, "python setup.py install"

For ipython you MUST have readline which does not come by default with osx. It is easy enough to install from this package:
http://pythonmac.org/packages/readline-5.0-py2.3-macosx10.3.zip

Install this package, then you need to either:
   1) move readline.so from /Library/Python/2.3 to /Library/Python/2.3/site-packages
   2) install http://pythonmac.org/packages/TigerPython23Compat.pkg.zip

For building matplotlib you can just use fink's libpng and freetype, or install them from source to /usr/local.

WX and Tk (and aggs) should work out of the box since both are included with tiger. This should be suffice for the setup you are wanting.

Again, it is a personal preference and this is just my preferred approach.

- Charlie

Derrick Snowden wrote:

···

Hi all,

Recently, a sizable thread accrued focused on different installation problems with matplotlib on Mac OSX. I largely ignored the thread since I work on a Linux machine at work and had a windows machine at home. Last week I pitched the Windows machine out the window and went to the store to buy a Mac.
I don't want to abuse the good nature of the people on this list but I was wondering if someone might have a pointer for a gentle intro to Python on the Mac. If there is a good place to get some background I might be able to avoid the standard newbie questions. For example I dutifully installed Fink and have been using it to install some Python packages. However I notice that the Python installation from fink seems to be different than Python that comes with OSX Panther (/Library/Python I think). I always hated having two versions of Python on windows (the windows native port and the cygwin python) but I saw no way around it. Should I anticipate having two python installations on the mac as well?

I guess what I'm asking for is not details on installation procedures but rather a couple of comments on "best practices" from some of the pros out there.

My goal would be to have a working python/numeric/numarry/ipython/matplotlib installation in the place that is easiest to maintain. I'm not a bleeding edge sort of user however...

Thanks for any comments...
Derrick

-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Derrick Snowden wrote:

someone might have a pointer for a gentle intro to
Python on the Mac. If there is a good place to get some background I might be able to avoid the standard newbie questions. For example I dutifully installed Fink and have been using it to install some Python packages. However I notice that the Python installation from fink seems to be different than Python that comes with OSX Panther (/Library/Python I think). I always hated having two versions of Python on windows (the windows native port and the cygwin python) but I saw no way around it. Should I anticipate having two python installations on the mac as well?

I think you've got the right impression, also reinforced by Jeff:

fink (and/or darwinports) is a lot like cygwin on Windows: A parallel unix-like system. I think Jeff has laid out very well why you'd want to use it: If you want a system that is pretty much like you'd get with other unixes. However, what this means is that it really is kind of distinct from the rest of OS-X, fink stuff works with fink stuff, and OS-X stuff works with OS-X stuff. My feeling is that it's easiest if, for a given purpose (say, python development), you go either all fink or no fink, and not try to mix them.

I'm going to give my opinion here as to what you should do:

If you want a system that is much like what you're used to with Linux (and cygwin), then go all-fink.

If you want to have your python work more integrated with OS-X (this is the approach I'm taking), then stick with the non-fink Python options:

1) subscribe to the python-mac mailing list:
http://www.python.org/sigs/pythonmac-sig/

2) Choose a version of Python. I'm assuming you have Tiger. It comes with python 3.2. You can use that, but I think more folks now are using Bob Ippolito's "official unofficial" 2.4.1 build:

http://undefined.org/python/

(also install the TigerPython24Fix)

3) Get any packages you can from:

http://pythonmac.org/packages/

If you can't get a package there, then you can usually it yourself. SciPy is a challenge in this regard, but most stuff is not too tough. I've contributed a build of matplotlib 0.82. In that package, I described how I did it, so if you want a newer version, you can build it yourself. If you do, please contribute it back to that repository, by posting to the pythonmac list.

Install Py2App, and then use bdist_mpkg to build mac packages of any extension you build, and then contibute them to pythonmac.org

As you are using other systems, I'd recomend wxPython (from pythonmac.org, or the wxPython site). It's not quite as maintained as PyGTK for matplotlib, but it works fine, and it's really the best option for cross platform development. For just the Mac, someone was working on a Cocoa back-end for matplotlib, you might want to look out for that.

-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...

Charles Moad wrote:

My 2 cents:

For ipython you MUST have readline which does not come by default with osx. It is easy enough to install from this package:
http://pythonmac.org/packages/readline-5.0-py2.3-macosx10.3.zip

Install this package, then you need to either:
   1) move readline.so from /Library/Python/2.3 to /Library/Python/2.3/site-packages
   2) install http://pythonmac.org/packages/TigerPython23Compat.pkg.zip

Thanks for this info. I hope you don't mind, I've copied it to the OSX section of the manual for the next release.

Cheers,

f

Derrick Snowden wrote:

Hi all,

Recently, a sizable thread accrued focused on different installation problems with matplotlib on Mac OSX. I largely ignored the thread since I work on a Linux machine at work and had a windows machine at home. Last week I pitched the Windows machine out the window and went to the store to buy a Mac.
I don't want to abuse the good nature of the people on this list but I was wondering if someone might have a pointer for a gentle intro to Python on the Mac. If there is a good place to get some background I might be able to avoid the standard newbie questions. For example I dutifully installed Fink and have been using it to install some Python packages. However I notice that the Python installation from fink seems to be different than Python that comes with OSX Panther (/Library/Python I think). I always hated having two versions of Python on windows (the windows native port and the cygwin python) but I saw no way around it. Should I anticipate having two python installations on the mac as well?

Derrick: Just thought of another reason why I prefer the fink, unix-x11 environment - you can run matplotlib remotely via an ssh tunnel and have the plot display back on your computer. I use this a lot when working from home - ssh to the mac on my desk at work, run my script and have the plot display back on my home computer. Can't do that with an aqua native matplotlib, unless you use remote desktop or VNC.

-Jeff

···

--
Jeffrey S. Whitaker Phone : (303)497-6313
Meteorologist FAX : (303)497-6449
NOAA/OAR/CDC R/CDC1 Email : Jeffrey.S.Whitaker@...259...
325 Broadway Office : Skaggs Research Cntr 1D-124
Boulder, CO, USA 80303-3328 Web : http://tinyurl.com/5telg

Hi Folks,

Has anyone got any code for making a Wind Rose with MPL? (I'd like to hear
about other pythonic methods too)

If you don't know what a Wind Rose is, you probably don't have code for making
one, but just in case you're curious, it's essentially a histogram in polar
coordinates. It can show you what fraction of the time the wind (or any
directional phenomenon) is is blowing from what direction.

here's some examples:

http://www.enviroware.com/windrose.htm

Or google it yourself.

If you don't mind self contained, Windows only software!

Thanks

-Chris

PS: Jeff, I cc's you, because you seemed a very likely candidate for having
something.

···

--
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...