MacOS Installation

Binary Installers

OSX install has become a challenge. With the Enthought transition to Canopy we cannot figure out clean install directions for 3rd party packages and therefore can no longer recommend using EPD for SpacePy.


The Python that ships with OSX is not going to work. We recommend Python 2.7 from


There is an OSX package at


If you wish to use CDF files, download and install the NASA CDF library. The default installation directory is recommended to help SpacePy find the library. There is an OSX install package.


easy_install –user ffnet


With the dependencies installed, SpacePy is ready to build and install. This uses the same basic setup as ffnet (standard Python distutils).


python build

If this fails, specify a FORTRAN compiler:

python build --fcompiler=gnu

(python build --help-fcompiler will list options for FORTRAN compilers.)

Install for one user:

python install --user

Or install for all users on the system:

sudo python install

Full MacPorts Install Instructions

These were current as of 13-May-2013, path especially go out of date quickly. We recommend installing this way for the best results.


  1. Install xcode from the app store
  2. Open xcode
  3. Xcode -> preferences -> Downloads -> install command line tools
  4. Install MacPorts (
  5. sudo port -v selfupdate
  6. sudo xcode-select -switch /Applications/
  7. sudo port install gcc49 +gfortran
  8. sudo port select gcc mp-gcc49
  9. sudo port install python27
  10. sudo port select –set python python27
  11. sudo port install py27-ipython py27-scipy py27-numpy py27-matplotlib readline py27-h5py ipython-select
  12. sudo port select –set ipython ipython27
  13. Download spacepy source (or clone from git) (


  1. python install -–user (in the spacepy directory after unzip)


  1. Create .matplotlib/matplotlibrc
  2. Add: backend : MacOSX
  3. Add: interactive : True