basemap ImportError: No module named 'mpl_toolkits.basemap'

帅比萌擦擦* 提交于 2019-12-06 09:23:43

问题


from mpl_toolkits.basemap import Basemap  

gives

ImportError: No module named 'mpl_toolkits.basemap'  

I installed basemap with conda

wayne@dors:~$ conda install basemap
Solving environment: done

# All requested packages already installed.  

I am running ubuntu 15.04, Python3.4, matplotlib 2.1.1, numpy 1.8.2
How do I fix?


回答1:


Try to install it with this command:

conda install -c conda-forge basemap

"Only the 'crude' and 'low', resolution datasets are installed by default" .You may need to install the following for high resolution:

conda install -c conda-forge basemap-data-hires



回答2:


I think you need to install from source, not via conda, as per the docs :

https://matplotlib.org/basemap/users/installing.html



来源:https://stackoverflow.com/questions/48388217/basemap-importerror-no-module-named-mpl-toolkits-basemap

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!