matplotlib - Python basemap module impossible to import

ID : 131349

viewed : 6

Tags : pythonmatplotlibimportmatplotlib-basemappython

Top 5 Answer for matplotlib - Python basemap module impossible to import

vote vote


I was in the same situation until a minute ago, installing it through this made the trick:

sudo apt-get install libgeos-3.5.0 sudo apt-get install libgeos-dev pip install 
vote vote


I was facing this issue and I was able to solve it using anaconda

After activating my profile

source activate MyProfileName conda install basemap  from mpl_toolkits.basemap import Basemap import matplotlib.pyplot as plt # setup Lambert Conformal basemap. # set resolution=None to skip processing of boundary datasets. m = Basemap(width=12000000,height=9000000,projection='lcc',             resolution=None,lat_1=45.,lat_2=55,lat_0=50,lon_0=-107.) m.bluemarble() 

BlueMarble format of basemap

vote vote


I do not use Anaconda, using MacOS, and I have found this solution works for me. I guess it is straight forward, and should work with both Linux and MacOs.

brew install geos pip3 install 

For Ubuntu,

sudo apt-get install geos sudo pip3 install 
vote vote


I had the same issue; trying to access basemap using sys would produce that error. But this worked for me:

import mpl_toolkits mpl_toolkits.__path__.append('/usr/lib/python2.7/dist-packages/mpl_toolkits/') from mpl_toolkits.basemap import Basemap 
vote vote


For me, a simple

pip3 install basemap 

did the trick.

Top 3 video Explaining matplotlib - Python basemap module impossible to import