Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Installing basemap on Mac / Python

Tags:

I'm having trouble to get the basemap to work in Python in my Mac.

I keep receiving:

    from mpl_toolkits.basemap import basemap ImportError: No module named basemap 

What I did:

brew install gdal brew install gets export GEOS_DIR=/usr/local/Cellar/geos/3.4.2/ basemap-1.0.7 $ python setup.py install 

I also tried:

basemap-1.0.7 $ cd geos-3.3.3 basemap-1.0.7/geos-3.3.3 $ export GEOS_DIR=~/ basemap-1.0.7/geos-3.3.3 $ ./configure --prefix=$GEOS_DIR basemap-1.0.7/geos-3.3.3 $ make basemap-1.0.7/geos-3.3.3 $ make install basemap-1.0.7/geos-3.3.3 $ cd .. basemap-1.0.7 $ python setup.py install 

None of them worked for me. How can I get this package to work on a MacOS Sierra?

like image 417
pceccon Avatar asked Feb 17 '17 13:02

pceccon


1 Answers

On 10.14 Mojave today I did:

brew install geos pip3 install https://github.com/matplotlib/basemap/archive/master.zip 

and it seems to work (mine is Python 3.6 from https://python.org with matplotlib installed by pip).

like image 154
Alexander Pavlov Avatar answered Sep 23 '22 02:09

Alexander Pavlov