google-colaboratorypython-xarraygeoviews

Install GeoViews on a Google Colaboratory Notebook


Is it possible to install geoviews on a Google Colaboratory notebook so that I can use it to plot data from an Xarray Dataset?


Solution

  • Geoviews depends on cartopy, which has some additional requirements that aren't covered by pip. You can install them with apt, at which point the geoviews installation will work correctly:

    !apt-get install libgeos++ libproj-dev
    !pip install geoviews
    

    After this, you can run a basic geoviews command:

    import geoviews as gv
    import geoviews.feature as gf
    
    gv.extension('matplotlib')
    gf.ocean
    

    enter image description here