0

How can we install geoplot in google colab?

!pip install geoplot

The above gives

Collecting geoplot
  Using cached https://files.pythonhosted.org/packages/e1/8f/46133752e1f02e70501939e739b81cbc85c79d7398c963b8a25a3178bffe/geoplot-0.4.1-py3-none-any.whl
Requirement already satisfied: mapclassify>=2.1 in /usr/local/lib/python3.6/dist-packages (from geoplot) (2.4.2)

But when I try to import geoplot the package is unrecognised

N Alpha
  • 33
  • 7

2 Answers2

1

I think they don't recommend using pip install geoplot here is a link to their documentation hope it helps you can use conda though.

DataCrusade1999
  • 492
  • 4
  • 4
1

Cartopy is required for geoplot. You need to use apt to install it. Then, you can install geoplot with pip normally.

!apt install python3-cartopy
!pip install geoplot

Here's an example colab notebook

korakot
  • 37,818
  • 16
  • 123
  • 144
  • I don't know about geoplot but would you mind telling the difference between `pip install pkg` and `!pip install pkg` as both of these give same results in my case – theProcrastinator Feb 09 '21 at 05:02
  • 1
    Colab use auto-magic. So `pip` becomes `%pip` automatically. But `!pip` which call command line is more explicit. Both methods wok, but if you use just `pip`, you cannot have the second line, you must have just 1-line cell. – korakot Feb 09 '21 at 07:18