How to install python Basemap library on Unix machine

How to install python Basemap library on Unix machine

Postby yiboj » Thu May 04, 2017 9:12 am

The matplotlib basemap toolkit is a library for plotting 2D data on maps in Python. It is similar in functionality to the matlab mapping toolbox, the IDL mapping facilities, GrADS, or the Generic Mapping Tools. PyNGL and CDAT are other libraries that provide similar capabilities in Python.

Users often encounter the issues with basemap since the default matplotlib does not come with basemap library, and basemap installation is tricky and requires some external packages to be installed first.

The following is the steps in order to install basemap successfully:

1. Download GEOS library from

I downloaded geos-3.6.1.tar.bz2 file in this example

2. Unpackage GEOS and make build:

Code: Select all
$> cd geos-3.6.1
# export GEOS_DIR=<where you want the libs and headers to go>
# A reasonable choice on a Unix-like system is /usr/local, or
# if you don't have permission to write there, your home directory.
$> export GEOS_DIR=~/GEOS_LIBS
$> ./configure --prefix=$GEOS_DIR
$> make
$> make install

3. Download and install basemap using pip
Code: Select all
$> pip install
Posts: 130
Joined: Mon Mar 30, 2015 11:22 am

Return to Tutorial