GmtPy is implemented in a single source file, which you may just place into the directory, where you want to use it. However I recommend to install it properly, as described below.


  • Python
  • GMT (e.g. gmt package on .deb based Linuxes)
  • NumPy (e.g. python-numpy package on .deb based Linuxes)
  • optional: pycdf (if you want to use the savegrd() and loadgrd() functions of GmtPy)

Ensure that the $GMTHOME environment variable is set properly.


GmtPy is hosted at GitHub, so the simplest way to download is to use git:

cd ~/src/   # or wherever you keep your source packages
git clone git:// gmtpy

Alternatively, you may download GmtPy as a tar archive, but updating is easier with the method described above.


To install GmtPy system wide (usually somewhere under /usr/local), simply run (from within GmtPy’s source directory):

sudo python install

It is also possible to install to a custom location. To do so, use the --prefix option of and adjust the environment variable $PYTHONPATH (see distutils documentation for details).


If you used git to download GmtPy, and you would later want to update, use the following commands (from within GmtPy’s source directory):

git pull origin master
sudo python install