Installation — pygrib documentation

# Installation

## Dependencies

- ECCODES C library.

- numpy

- pyproj

- cython (only needed at build-time)

## Instructions

The easiest way to get everything installed (on macosx and linux) is to use pip:

    >>> pip install pygrib

This will install all the dependencies for you (including the ECCODES C lib).

If you’re using Anaconda python (recommended for Windows), use conda:

    >>> conda install -c conda-forge pygrib

If using conda on windows, you may also need to set the `ECCODES_DEFINITION_PATH` environment variable to `$CONDA_PREFIX/Library/share/eccodes/definitions` if you see an error saying `boot.def` cannot be found.

## Developing

To build from source, clone the github repository and install:

    >>> git clone https://github.com/jswhit/pygrib
    >>> cd pygrib
    >>> ECCODES_DIR=path/to/eccodes pip install -e .

where `$ECCODES_DIR` is the path to the directory containing `include/grib_api.h` and `lib/libeccodes.so`. If `ECCODES_DIR` is not specified, a few common locations such as `$CONDA_PREFIX,/usr,/usr/local,/opt/local` will be searched.. Then run the simple test script to check if things are working `cd test; python test.py`.

To be able to run all the tests, install pytest and run

    >>> export MPLBACKEND=agg
    >>> cd test
    >>> pytest test*py --mpl --mpl-baseline-path=baseline_images

Many tests require matplotlib, pytest-mpl and cartopy. If you don’t want to install those, just run `test.py` and `test_latlons.py`.