Installing NumPy, Matplotlib, and SciPy on Mac OS X
You can install NumPy, Matplotlib, and SciPy on the Mac with a graphical installer or from the command line with a port manager, such as MacPorts or Fink, depending on your preference.
Note
We can get a NumPy installer from the SourceForge website at http://sourceforge.net/projects/numpy/files/. Similar files exist for Matplotlib and SciPy. Just change numpy
in the previous URL to scipy
or matplotlib
. IPython didn't have a GUI installer at the time of writing. Download the appropriate DMG file as shown in the following screenshot; usually the latest one is the best. Another alternative is the SciPy Superpack (https://github.com/fonnesbeck/ScipySuperpack). Whichever option you choose, it is important to make sure that updates which impact the system Python library don't negatively influence the already installed software by not building against the Python library provided by Apple.
We will install NumPy with a GUI installer using the following steps:
Open the DMG file as shown in the following screenshot (in this example,
numpy-1.8.0-py2.7-python.org-macosx10.6.dmg
):Double-click on the icon of the opened box, that is, the one having a subscript that ends with
.mpkg
. We will be presented with the welcome screen of the installer.Click on the Continue button to go to the Read Me screen, where we will be presented with a short description of NumPy, as shown in the following screenshot:
Click on the Continue button to go to the License screen.
Read the license, click on the Continue button, and then on the Accept button, when prompted to accept the license. Continue through the next screens and click on the Finish button at the end.
Alternatively, we can install NumPy, SciPy, Matplotlib, and IPython through the MacPorts route or with Fink. The following installation steps install all these packages. We only need NumPy for the tutorials in this book, so please omit the packages you are not interested in.
To install with MacPorts, type the following command:
sudo port install py-numpy py-scipy py-matplotlib py-ipython
Fink also has packages for NumPy:
scipy-core-py24
,scipy-core-py25
, andscipy-core-py26
. The SciPy packages are:scipy-py24
,scipy-py25
, andscipy-py26
. We can install NumPy and the other recommended packages that we will be using in this book for Python 2.6 with the following command:fink install scipy-core-py26 scipy-py26 matplotlib-py26