scipy on Leopard
So, I made the jump to Leopard on one of my three Macs (a PowerBook G4). The biggest question when making the jump was if it would be possible to get scipy up and running.
Well, it turns out that Fink doesn't have a package of scipy for Leopard, darwinports package won't compile (it stops at g95), installing python 2.4 and downloading the scipy-package from python.org doesn't work and the otherwise excellent SciPy SuperPackage by Chris Fonnesbeck won't work either (and looks like he won't update the PPC version anymore anyway).
Is there a package that I have missed? Any good instructions for compiling scipy that works on Leopard? Or perhaps a simple modification to make these packages work for Leopard?



Yes, I too have the same
Yes, I too have the same problem on a PPC Mac (Quad G5) that I recently upgraded to Leopard. Tried the same install routes none of which worked either. I would greatly appreciate hearing from anyone who has successfully managed to install scipy 0.6.0 on their PPC Mac running Leopard. Thanks!
Me too
I've also been unable to install SciPy, with the same error. It is nice that NumPy comes with Leopard, however.
and matplotlib?
Anyone managed to get matplotlib working? What's the best way to get a nice science Python environment in Leopard? I think I will have to wait to upgrade until this is sorted...
provisional Matplotlib packages for Leopard
At the moment this is packaged for internal use at NRAO, so note the odd installation location: /opt/casa/patch_3/3rd-party
But if you try it, it'll indicate to me that I'm on the right track, and I can submit these changes to MacPorts...
Hope this helps
Get it here:
Without Qt4 GUI (only 6 megabytes, but may not work):
http://casa.nrao.edu/distro/darwin/intel/darwin-9/diskfiles/_bits/mpl-packages-leopoard.dmg
With full Qt4 GUI setup: (ten times as big, but what I've tested):
http://casa.nrao.edu/distro/darwin/intel/darwin-9/diskfiles/_bits/mpl-qt-packages-leopoard.dmg
The Python packages install into
/Library/Python/2.5/site-packages
but the /usr/local/{bin,lib,share} bits get installed into an odd place:
/opt/casa/patch_3/3rd-party
I will likely change this someday. At the moment one arbitrary location is as good as another, and this location doesn't stomp on other things.
SO YOU'LL HAVE TO ADD /opt/casa/patch_3/3rd-party/bin TO YOUR PATH IN ORDER TO USE THE IPYTHON THAT'S INCLUDED
BUT
I don't think you'll have to do any path manipulation in order to use Matplotlib.
FINAL NOTE
By default, the backend is the included TkAgg backend.
Note the location of the Matplotlib configuration file
/Library/Python/2.5/site-packages/matplotlib/mpl-data/matplotlibrc
Works with gfortran
I managed to install scipy+matplotlib from the sources using MacPorts GCC42 (4.2.2) to give me gfortran. I created a link
/opt/local/bin/gfortran -> gfortran-mp-4.2and also had to change the file/System/Library/Frameworks/Python.framework/Versions/2.5/Extras/lib/python/numpy/distutils/fcompiler/gnu.py
in line 243 from
version_match = simple_version_match(start='GNU Fortran 95')to
version_match = simple_version_match(start='GNU Fortran')and that's it, everything worked.
I didn't use fortran for my matplotlib pacakges
I didn't use FORTRAN for my matplotlib packages.
Those packages aren't a complete scipy installation.
We have used gfortran 4.2.1 since it was released for our internal numpy/scipy builds on Tiger...
Although the modification to the /System... numpy is rather benign, I don't think it is a good idea to rely upon modifications to things under /System -- if we have to do so, then we're either doing something wrong or Apple is doing something wrong (and we should file a bug). I think that RuiPereira's tweak is in the "file a bug" category...
... but until they change it I'd recommend installing your own numpy in /Library/Python/2.5/site-packages.
The HUGE problem with doing so is that Apple's system Python uses the /Library.../site-packages at the END of sys.path.
The work-around is to put a Python .pth file in /Library/../site-packages that modifies the sys.path to put it before Apple's /System packages.
Ouch.
But I think a user-installed numpy in /Library/Python/2.5/site-packages can be made to work.
Clean install
Right, there's no need of gfortran for matplotlib
I just made a clean reinstall of numpy+scipy (with gfortran 4.2.2) and matplotlib from source and everything is working:
- to make python use the
/Library/Python/2.5/site-packagesnumpy just define the system variable $PYTHONPATH, as inexport PYTHONPATH="/Library/Python/2.5/site-packages", it will take precedence over the /System/Library... one- the latest numpy (1.0.4) has an updated gnu.py, so no more need for patching
- scipy compiled ok with the user-installed numpy
- to compile matplotlib I had to change setupext.py line 51, adding
'/usr/X11'to the darwin array, so that it could find libpng and suchCheers,
Rui
OSX Leopard Install TkAgg Problem and Solution
Thanks for the tip about /usr/X11, with this in place I too was able to install Matplotlib 0.90.1 from source on a G4 Powerbook and a dual G5 PowerMac, both running OSX 10.5.1. Installation proceeded smoothly and once the by now well documented python path issue had been fixed, Matplotlib imported and ran fine with the Agg back-end.
However, attempting to use TkAgg led to an allocation error somewhere deep in Tcl. I finally traced this to the fact that I had a legacy version of the Tcl and Tk frameworks in /Library/Frameworks. These were being used in preference to the Leopard installed frameworks in /System//Library/Frameworks. Removing the /Library/Frameworks solved these problems.
Instead of setting the PYTHONPATH variable, I have been using the trick posted by Jack Jansen on pythonmac of including a FixPythonPath.pth (precise name doesn't matter) file in /Library/Python/2.5/site-packages with the line
import sys; sys.path.insert(0, "/Library/Python/2.5/site-packages");
Actually this results in /Library/Python/2.5/site-packages ending up in the python path twice, so I actually use
import sys; sys.path.remove('/Library/Python/2.5/site-packages'); sys.path.insert(0, "/Library/Python/2.5/site-packages");
J.
Fink and Xquartz
I had a similar problem with Scipy and matplotlib. After some reading on the Fink site, I found a way to do it. First you need to install a clean version of Fink from source, which is fairly straightforward from Fink's documentation. The source can be obtained at http://www.finkproject.org/download/srcdist.php. All the packages downloaded must be built on your computer, so this means no binary installations. In addition, to remedy the issue with X11 on Leopard, you have to install the latest XQuarts software (http://trac.macosforge.org/projects/xquartz). XQuarts allowed me to call up matplotlib without problems.
Building from source on Fink has an advantage and disadvantage: faster processing and slow installations, respectively. I noticed that Scipy, IPython, and matplotlib are more stable and compute information much faster than the binaries on Tiger. Hope the information helps.
Cheers,
Eli
Installing scipy on Leopard
I have gotten scipy (including numpy) working on leopard via their instructions and using the version of gfortran at the website:
http://r.research.att.com/tools/
It requires you to use the experimental apple build of gcc 4.2 but I have had no problems thus far although scipy does seem to fail some of its internal tests, specifically with round off error.
Matplotlib of course does not require an installation of gfortran but it seems to work just fine with the standard apple installation of python and gcc 4.2 (again from apple).
If anyone has a specific error they are running into post it here and hopefully someone can help you out or check out the scipy and numpy forums, they are usually a good place to go for help on installation.