1. 下载 basemap 包
https://github.com/matplotlib/basemap/releases
2. 解压
tar -zxvf basemap-1.2.1rel.tar.gz
3. 安装依赖包 pip install numpy -i https://mirrors.aliyun.com/pypi/simple
pip install matplotlib -i https://mirrors.aliyun.com/pypi/simple
pip install pyproj -i https://mirrors.aliyun.com/pypi/simple
pip install pyshp -i https://mirrors.aliyun.com/pypi/simple
4. 编译安装 geos 库
cd basemap-1.2.1rel/geos-3.3.3/
export GEOS_DIR=/usr/local
./configure --prefix=$GEOS_DIR
vim /home/basemap-1.1.0/geos-3.3.3/include/geos/platform.h
改:/* #undef HAVE_ISNAN */
为:#define HAVE_ISNAN 1
为:#define HAVE_ISNAN 1
make
make install
5. 安装 basemap
cd ..
python setup.py install
6. 测试 cd examples/ python simpletest.py