Menu

[r6169]: / trunk / toolkits / basemap / doc / users / installing.rst  Maximize  Restore  History

Download this file

100 lines (70 with data), 3.9 kB

Installing

Dependencies

Requirements

These are external packages which you will need to install before installing basemap.

matplotlib 0.98 (or later, download)

python 2.4 (or later but not python3)
matplotlib requires python 2.4 or later (download)
numpy 1.1 (or later)
array support for python (download)

Required libraries that ship with basemap

GEOS (Geometry Engine - Open Source) library 2.2.3 or later (2.2.3 recommended).
Source code is included in the geos-2.2.3 directory. When building from source, must be built and installed separately from basemap (see build instructions below). Included in Windows binary installers.
PROJ4 Cartographic Projections Library.
Patched version automatically built into basemap.
pyshapelib
C library with python interface for reading ESRI shapefiles (automatically built and installed with basemap).
pupnyere
Pure python netCDF interface automatically installed with basemap.
pydap
Pure python OPeNDAP implementation. If not present, client (not server) will be installed with basemap.
httplib2 (needed for pydap client).
If not present, will be installed with basemap.

Optional libraries

PIL
Python Imaging Library (download), only needed for :func:`~mpl_toolkits.basemap.Basemap.bluemarble` and :func:`~mpl_toolkits.basemap.Basemap.warpimage` instance methods.

Installation

Windows binary installers are available for download.

For other platforms, download the source release and follow these steps:

  • Install pre-requisite requirements.

  • Untar the basemap version X.Y.Z source tar.gz file, and and cd to the basemap-X.Y.Z directory.

  • Install the GEOS library. If you already have it on your system, just set the environment variable GEOS_DIR to point to the location of libgeos_c and geos_c.h (if libgeos_c is in /usr/local/lib and geos_c.h is in /usr/local/include, set GEOS_DIR to /usr/local). Then go to next step. If you don't have it, you can build it from the source code included with basemap by following these steps:

    cd geos-2.2.3
    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.
    ./configure --prefix=$GEOS_DIR
    make; make install
    
  • cd back to the top level basemap directory (basemap-X.Y.Z) and run the usual python setup.py install. Check your installation by running from mpl_toolkits.basemap import Basemap at the python prompt.

    Basemap includes two auxilliary packages, pydap and httplib2. By default, setup.py checks to see if these are already installed, and if so does not try to overwrite them. If you get import errors related to either of these two packages, edit setup.cfg and set pydap and/or httplib2 to True to force installation of the included versions.

  • To test, cd to the examples directory and run python simpletest.py. To run all the examples (except those that have extra dependencies or require an internet connection), execute python run_all.py.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.