Skip to content

Instantly share code, notes, and snippets.

@junzis
Last active December 4, 2021 01:22
Show Gist options
  • Star 15 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save junzis/36fee36acd7cadfdf1c01c06d97f4947 to your computer and use it in GitHub Desktop.
Save junzis/36fee36acd7cadfdf1c01c06d97f4947 to your computer and use it in GitHub Desktop.
install basemap quickly on ubuntu
sudo apt-get install libgeos-3.X.X
sudo apt-get install libgeos-dev
pip install --user https://github.com/matplotlib/basemap/archive/master.zip
@jaecheverrip
Copy link

thanks a lot, it was the only way thats work for me, to resolve the problem KeyError 'PROJ_LIB' martinchristen/EuroSciPy2018#2

@blurLake
Copy link

what about on windows? help!

@yuboxun
Copy link

yuboxun commented Dec 24, 2018

@pavlokurochka
Copy link

pavlokurochka commented Jan 8, 2019

@yingjd
Copy link

yingjd commented Feb 11, 2019

is this for mac system ??

@hafez-ahmad
Copy link

/Downloads$ pip3 install --user https://github.com/matplotlib/basemap/archive/master.zip
Collecting https://github.com/matplotlib/basemap/archive/master.zip
Downloading https://github.com/matplotlib/basemap/archive/master.zip (133.1MB)
99% |████████████████████████████████| 133.1MB 538kB/s eta 0:00:01Killed
hafez@hafez:
/Downloads$ ls
basemap-1.2.1-cp36-cp36m-win_amd64.whl matplotlib-1.5.0
basemap-master matplotlib-1.5.0.tar.gz
basemap-master.zip pyroms
hafez@hafez:~/Downloads$ python3
Python 3.6.9 (default, Nov 7 2019, 10:44:02)
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.

import pyroms
Traceback (most recent call last):
File "", line 1, in
File "/home/hafez/Downloads/pyroms/pyroms/pyroms/init.py", line 14, in
from . import hgrid
File "/home/hafez/Downloads/pyroms/pyroms/pyroms/hgrid.py", line 22, in
from mpl_toolkits.basemap import Basemap
ModuleNotFoundError: No module named 'mpl_toolkits.basemap'
from mpl_toolkits.basemap import Basemap
Traceback (most recent call last):
File "", line 1, in
ModuleNotFoundError: No module named 'mpl_toolkits.basemap'
from mpl_toolkits.basemap import Basemap
Traceback (most recent call last):
File "", line 1, in
ModuleNotFoundError: No module named 'mpl_toolkits.basemap'

@s-bn
Copy link

s-bn commented Jun 20, 2020

thanks a lot, it was the only way thats work for me, to resolve the problem KeyError 'PROJ_LIB' martinchristen/EuroSciPy2018#2

I was so happy when I read this and knew I'd finally be able to get basemap to work!!

@junzis
Copy link
Author

junzis commented Jul 13, 2020

This gist was created quite a long time ago.

I recommend using anaconda in order to install basemap properly.

Or even better, you should consider switching to cartopy, which is more powerful than basemap. It can also be easily installed using anaconda.

@hafez-ahmad
Copy link

Yeah, I agree, switch cartopy which same functionality.

@Naeemkh
Copy link

Naeemkh commented Aug 2, 2020

I used anaconda; it works ok on the local machine; however, it gives different frustrating errors on the CI. I am considering switching to cartopy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment