Menu

Python Installation Instructions

mrayson

Python library installation instructions

Information about the necessary python libraries to run the SUNTANS examples and view the output.

Step 1: Install Python 2.7

Your operating system may have python pre-installed but if it is not version 2.7 then install version 2.7!

Step 2: Install essential python libraries

The following libraries are fairly standard and essential for most of the tasks related to pre and post-processing SUNTANS data. Most packages should be readily available on most platforms and easily installable via things like:

sudo apt-get install python-numpy

or if you download a package from source:

sudo python setup.py install

Check each library for details.

numpy

www.numpy.org

Basic scientific computing libraries including matrix and array operations.

scipy

www.scipy.org

More scientific computing libraries.

matplotlib

www.matplotlib.org

Main plotting routines live here.

netcdf4-python

Google code documentation

Library for interfacing with netcdf4 files. See [Netcdf Compilation Instructions] wiki for details on the installation.

Step 3: Install non-essential libraries

The following non-pertinent libraries are required for some tasks but most examples should run without them

wxPython

wxPython Installation

This is required by the main plotting gui sunplotpy.

GDAL

GDAL homepage

Geospatial Data Abstraction Library for mapping/GIS tasks like lat-lon to UTM conversion.

Mayavi

Mayavi homepage

3D visualization libraries. Looks good.


Adrean Webb's instructions

1. Install homebrew:

http://brew.sh/

2. Run:

> brew doctor
> brew update
> brew upgrade

> pip install numpy
> pip install scipy
> pip install gdal

> ln -s /usr/local/opt/freetype/include/freetype2 /usr/local/include/freetype

> pip install matplotlib

> brew install wxmac

> tap homebrew/homebrew-science
> brew update

> brew hdf5
> brew netcdf
> pip install netcdf4

3. Add the following to .bash_profile:

export PYTHONPATH=/usr/local/bin
export LD_LIBRARY_PATH=/usr/local/lib

4. Add the pointers to the SUNTANS python scripts:

PYTHON_SUNTANS=<enter></enter>

export PYTHONPATH=${PYTHON_SUNTANS}/DataDownload:${PYTHON_SUNTANS}/DataIO:${PYTHON_SUNTANS}/GIS:${PYTHON_SUNTANS}/SUNTANS:${PYTHON_SUNTANS}/Utils

5. Modify python pointer in sunplot.py to:

!/usr/local/bin/python


Related

Wiki: Netcdf Compilation Instructions