我试过了
pip3 install basemap
但Basemap似乎不在PyPI上。
有an old question但它没有答案。
python3-dev
已安装我不知道在哪里/如何获得GEOS(libgeos-dev
?)。我想我遵循README并没有显示任何错误,但是在尝试this的第一行时
$ python3
>>> from mpl_toolkits.basemap import Basemap
我明白了
ImportError: libgeos-3.3.3.so: cannot open shared object file: No such file or directory
它在
$ locate libgeos-3.3.3.so
/home/math/Downloads/basemap-1.0.7/geos-3.3.3/src/.libs/libgeos-3.3.3.so
/usr/local/lib/libgeos-3.3.3.so
在Ubuntu中,这对我有用:
$ sudo apt-get install libgeos-dev
$ pip install --user https://github.com/matplotlib/basemap/archive/master.zip
为了完整起见,如果您知道需要特定版本,可以通过将鼠标悬停在需要here的软件包/版本号上来找到下载链接。例如,如果我需要安装v1.1.0,我可以使用上面的代码,用第二行代替:
$ pip install --user https://github.com/matplotlib/basemap/archive/v1.1.0.zip
试试这个:
sudo apt-get install libgeos-dev
sudo pip3 install -U git+https://github.com/matplotlib/basemap.git # latest Version from Source
旧版本可能与matplotlib不兼容。