So here it goes, for my future self and anybody else who can use it.
- Install Xcode from the app store. It's free and can be found here. Make sure to open Xcode and agree to it's terms and conditions.
- Download and install the enthought canopy python distribution. This is their free python version, which entails numpy, scipy and matplotlib.
To finish the canopy installation it is necessary to open the application Canopy. If this is done by double-clicking the icon, it will give the error message "Enthought Canopy can't be opened because it is from an unidentified developer". To get around this, it is necessary to right-click (CTRL-click) on the icon of Canopy and choose "open". In the pop-up window choose "Open" - and the program installs.
After this a new pop-up window appears asking "Do you want to make Canopy your default Python environment?", to which you answer "yes".
- Now we want install homebrew. Homebrew is a package manager similar to macports and fink. It is installed by opening the terminal and typing:
$ ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
You will be asked for your password and need to wait a few moments for the installation. - To install the Geos package type:
$ brew install gdal
Note the location of the Geos library. For me: /usr/local/Cellar/geos/3.5.0
The path written in the last line after installation indicates the location of the geos library, for me this was: /usr/local/Cellar/gdal/1.11.3_1 - To install Basemap it must first be downloaded. On this page, choose the newest version and download the tar-file for mac. Then go to the Downloads folder in the terminal and unpack the files:$ cd ~/Downloads/$ tar xf basemap-1.0.7.tar.gzThis creates a new folder with the name of the tar file, in my case ~/Downloads/basemap-1.0.7. You need to enter that folder:
$ cd basemap-1.0.7 - Then export the directory of geos library noted above and install baseman:
$ export GEOS_DIR=/usr/local/Cellar/geos/3.5.0/
To build and install write:
$ sudo python setup.py build
$ sudo python setup.py install
You will be asked for your password, and the installation will take a little while to run.
- And now python should work with basemap. You can test in the terminal by writing opening python and loading basemap:
$ python
>>> from mpl_toolkits import BasemapIf this works without error messages everything is fine. For me it worked for the last two computers - this time it worked after a restart. Awesome.














