HOW to install Basemap ?? | Sololearn: Learn to code for FREE!

+2

HOW to install Basemap ??

from mpl_toolkits.basemap import Basemap This is the command I used to install it? Then it showed me the module found error Then i used "pip instal mpl_toolkits" sommand to install it. After that it got installed successfully but when I tried "from mpl_toolkits.basemap import Basemap" again it showed me the modulefound error again? This is my code from mpl_toolkits.basemap import Basemap import matplotlib.pyplot as plt def mapTut(): m = Basemap(projection='mill',llcrnrlat=20,urcrnrlat=50,\ llcrnrlon=-130,urcrnrlon=-60,resolution='c') m.drawcoastlines() m.drawcountries() m.drawstates() m.fillcontinents(color='#04BAE3',lake_color='#FFFFFF') m.drawmapboundary(fill_color='#FFFFFF') # Houston, Texas lat,lon = 29.7630556,-95.3630556 x,y = m(lon,lat) m.plot(x,y, 'ro') lon, lat = -104.237, 40.125 # Location of Boulder xpt,ypt = m(lon,lat) m.plot(xpt,ypt, 'go') plt.title("Geo Plotting") plt.show() mapTut() What should i do?

3/31/2021 4:48:53 AM

K.S.S. Karunarathne

5 Answers

New Answer

+1

CoolDie This isn't working

+1

Then what should I do?

0

Open a terminal and type "pip install basemap" or in an interpretator: >>> import pip >>> pip.main(["install", "basemap", "--user"])

0

Such a library does not exist .-.

0

K.S.S. Karunarathne (Active Challenger) I knew already