What works is
import mpl_toolkits
What not works is (Import Error basemap not found)
from mpl_toolkits.basemap import Basemap
I followed the instructions here :
http://matplotlib.org/basemap/users/installing.html
Downloaded the lastest basemap*.tar.gz
I run the following commands:
Inside the geos folder
export GEOS_DIR=~/
./configure --prefix=$GEOS_DIR
make
make install
Inside the basemap folder
python setup.py install
Everything runs in sudo mode and no errors. Goes outputs no python binding but not as an error so i am not sure.
It seems not to be properly installed.
Mac Os X 10.10 Yosemite Python 2.7.6
if i type
pip install basemap --allow-external basemap --allow-unverified basemap
Requirement already satisfied (use --upgrade to upgrade): basemap in /Library/Python/2.7/site-packages
so it is there but not importable?
What worked for me was this:
brew install gdal
For completeness, I did these things too:
conda install basemap
But this should be similar to your pip install method above.
Also, for completeness, I added this line to my .bash_profile:
export GEOS_DIR=/usr/local/Cellar/geos/3.4.2/
You may need to edit the version number.
Then, you can run:
from mpl_toolkits.basemap import Basemap
The easiest way to install basemap on OS X is to use Ports.
Just type in the below command and the see the magic unfold:
port install py-matplotlib-basemap
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With