I'm using google Colab notebook for a project that requires me to plot GPS coordinates on a map. I want to use basemap for this purpose. I tried to import it on the Colab notebook by usingfrom mpl_tools.basemap import Basemap
and it showed up the following error:
ModuleNotFoundError Traceback (most recent call last)
<ipython-input-24-2cb85a2f9bb7> in <module>()
----> 1 from mpl_tools.basemap import Basemap
ModuleNotFoundError: No module named 'mpl_tools'
I need to install the basemap module in order to use it. I tried !pip install basemap
and tried to run it on Colab and that did not work.
!apt-get install libgeos-3.5.0
!apt-get install libgeos-dev
!pip install https://github.com/matplotlib/basemap/archive/master.zip
There is a problem with pyproj 2.0.1, so we need to downgrade it:
!pip install pyproj==1.9.6
restart runtime
from mpl_toolkits.basemap import Basemap
import matplotlib.pyplot as plt
%matplotlib inline
This works for me on Colab on April 7, 2019. I can now set up and plot maps.
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