【记录】Mac上使用终端安装Python Basemap库
【记录】Mac上使用终端安装Python Basemap库
Prerequisite
安装basemap首先需要安装geos 和 pyproj 两个库。
python3 使用 sudo pip3 install
安装Basemap
下载 Basemap,安装在根目录下。(密码:wk27)
tar zxvf basemap-1.1.0.tar.gz
cd basemap-1.1.0
cd geos-3.3.3
export GEOS_DIR=/user/local
./configure --prefix=$GEOS_DIR
make
make install
sudo python3 setup.py install
为了测试,可以进入example文件夹中,运行
python3 simpletest.py
或者
python3 run_all.py
可能会遇到的问题
AttributeError: module ‘pyproj’ has no attribute ‘pyproj_datadir’
使用pip3 install pyproj==1.9.6
ImportError: cannot import name ‘is_scalar’
进入matplotlib文件夹中的cbook,打开__init__.py
将from matplotlib.cbook import is_scalar, dedent 改成from matplotlib.cbook import is_scalar_or_string, dedent

浙公网安备 33010602011771号