🚨 This package is in early stages of design and implementation. 🚨
You’ll need Python 3.6 or greater to run PyGMT.
We recommend using the Anaconda Python
distribution to ensure you have all dependencies installed and the
package manager available.
Installing Anaconda does not require administrative rights to your computer and
doesn’t interfere with any other Python installations in your system.
You’ll need the latest development version available from the GitHub repository. PyGMT is based on GMT 6, which has not yet been officially released.
We need the very latest GMT since there are many changes being made to GMT itself in response to the development of PyGMT, mainly the new modern execution mode.
PyGMT requires the following libraries:
The following are optional (but recommended) dependencies:
IPython: For embedding the figures in Jupyter notebooks.
Unfortunately, you’ll have to build GMT from source in order to get PyGMT working. Please follow the instructions at http://gmt.soest.hawaii.edu/projects/gmt/wiki/BuildingGMT.
For Windows users, you can also try to install the binaries of GMT development version, available from http://w3.ualg.pt/~jluis/mirone/downloads/gmt.html. Currently, we don’t have tests running on Windows yet, so things might be broken. Please report any errors by creating an issue on Github.
We used to maintain conda packages for the latest GMT. That caused many problems and was very difficult to maintain updated. We have opted to not do that anymore so that we can develop more quickly. Once GMT 6 is officially released, we’ll have conda packages available again. Please bear with us.
Before installing PyGMT, we must install its dependencies.
The easiest way to do this is using the
conda package manager.
We recommend working in an isolated
to avoid issues with competing versions of its dependencies.
We can create a new conda environment with Python and all our dependencies installed
(we’ll call it
pygmt but you can change it to whatever you want):
conda create --name pygmt python=3.6 pip numpy pandas xarray packaging
Activate the environment by running:
source activate pygmt
From now on, all commands will take place inside the environment and won’t affect your default installation.
Now that you have GMT installed and your conda environment activated,
pip to install the latest source of PyGMT from Github:
pip install https://github.com/GenericMappingTools/pygmt/archive/master.zip
Alternatively, you can clone the git repository and install using
git clone https://github.com/GenericMappingTools/pygmt.git cd pygmt pip install .
This will allow you to use the
pygmt library from Python.
Testing your install¶
PyGMT ships with a full test suite. You can run our tests after you install it but you will need a few extra dependencies as well (be sure to have your conda env activated):
conda install pytest pytest-mpl sphinx jinja2 docutils ipython
Test your installation by running the following inside a Python interpreter:
import pygmt pygmt.test()