Skip to content

Latest commit

 

History

History
79 lines (53 loc) · 3.39 KB

osx-anaconda.md

File metadata and controls

79 lines (53 loc) · 3.39 KB

Setting up requirements for Using Geospatial Data with Python tutorial using Anaconda on Mac OS X

Serge Rey <sjsrey@gmail.com>

2013-06-21

Below I explain how to set up an Anaconda environment that isolates the new dependencies required for the scipy13 tutorial.

The installation is done on OS X 10.8.4.

Set up an Anaconda environment

  1. Download Anaconda
    Get the 64bit version
  2. cd ~/Downloads
  3. bash <Downloaded file>
    During this accept all the defaults and say yes when it asks to prepend anaconda to your PATH variable in your .bashrc
  4. cd
  5. source .bashrc
  6. ipython
  7. You should see ipython fire up with info that it is part of Anaconda 1.X or so
  8. Quit python and get back to the terminal.
  9. conda create -n scipygis scikit-learn
    I am using scikit-learn as a departure point for some of the core dependencies (numpy, scipy, etc)
  10. Install setuptools into this env
    1. Download setuptools
    2. tar xzvf setuptools-0.7.4.tar.gz
    3. cd setuptools-0.7.4
    4. ~/anaconda/envs/scipygis/bin/python setup.py install
  11. Install pip
    1. Download pip
    2. tar xzvf pip-1.3.1.tar.gz
    3. cd pip-1.3.1
    4. ~/anaconda/envs/scipygis/bin/python setup.py install

Install KingChaos Frameworks

These will get the GDAL and GEOS frameworks installed. If you already have installed these as part of getting QGIS on the Mac up and running, you won't need to reinstall. If so skip to the next section.

  1. Download GDAL Framework
  2. Open the dmg.
  3. Double click the GDAL Complete.pkg file and install.

Install GDAL Python wrappers

  1. Download gdal
  2. cd ~/Downloads
  3. tar xzvf GDAL-1.9.1.tar.gz
  4. cd GDAL-1.9.1
  5. ~/anaconda/envs/scipygis/bin/python setup.py build_ext -I/Library/Frameworks/GDAL.framework/Versions/1.9/unix/include -L/Library/Frameworks/GDAL.framework/Versions/1.9/unix/lib -lgdal install

Installing Fiona

  1. git clone git://github.com/Toblerity/Fiona.git
  2. cd Fiona
  3. ~/anaconda/envs/scipygis/bin/python setup.py build_ext -I/Library/Frameworks/GDAL.framework/Versions/1.9/unix/include -L/Library/Frameworks/GDAL.framework/Versions/1.9/unix/lib -lgdal install

Installing Basemap

  1. Download basemap
  2. tar xzvf basemap-1.0.6.tar.gz
  3. cd basemap-1.0.6
  4. export GEOS_DIR=/Library/Frameworks/GEOS.framework/unix
  5. ~/anaconda/envs/scipygis/bin/python setup.py install

Other dependencies

All other dependencies were installed with:

   ~/anaconda/envs/scipygis/bin/pip install <package>

The only exception to this is cartopy which I could not get installed within the Anaconda env. I didn't want to go the brew route so I left it out since the testing script passes.