Book Image

Learning NumPy Array

By : Ivan Idris
Book Image

Learning NumPy Array

By: Ivan Idris

Overview of this book

Table of Contents (14 chapters)
Learning NumPy Array
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

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:

  1. Open the DMG file as shown in the following screenshot (in this example, numpy-1.8.0-py2.7-python.org-macosx10.6.dmg):

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

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

  4. Click on the Continue button to go to the License screen.

  5. 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, and scipy-core-py26. The SciPy packages are: scipy-py24, scipy-py25, and scipy-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