I have problems importing basemap, even though I just installed it via pip install basemap
. I've tried both with python2.7 and python3:
python3
>>> from mpl_toolkits.basemap import Basemap
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named 'mpl_toolkits'
python2.7
>>> from mpl_toolkits.basemap import Basemap
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python2.7/site-packages/mpl_toolkits/basemap/__init__.py", line 37, in <module>
import _geoslib
ImportError: libgeos_c.so.1: cannot open shared object file: No such file or directory
I'm on a ubuntu OS.
What worked for me on ubuntu:
sudo apt-get install libgeos-3.4.2
sudo apt-get install libgeos-dev
sudo pip install https://github.com/matplotlib/basemap/archive/master.zip
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