ModuleNotFoundError: No module named 'mpl_toolkits.basemap'

二次信任 提交于 2020-01-06 09:05:24

问题


I have trouble importing the basemap module of mpl_toolkits in python. I've got following error message when I try to run "from mpl_toolkits.basemap import Basemap":

ModuleNotFoundError: No module named 'mpl_toolkits.basemap'

I'm using python 3.6.5 in windows.

I've found relevant Q&A in "Python basemap module impossible to import" and I already followed what's instructed there (i.e. source activate MyProfileName, conda install basemap) but it didn't work.

The clue might already be given in the Q&A above but as I'm quite new to python, I couldn't figure out the solution.


回答1:


I would recommend installing Anaconda environment from scratch. Let Anaconda handle dependencies for you. Then you need to install mpl_toolkits separately in your conda environment with:

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

See also here.

After doing this, executing

from mpl_toolkits.basemap import Basemap

from python console should work normally.



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

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