Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Colab error : ModuleNotFoundError: No module named 'geopandas'

When I try to import geopandas package in "Google Colaboratory" I got the error "ModuleNotFoundError: No module named 'geopandas'".

I will appreciate your help. Thanks in advance.

like image 677
Juan Nolazco Avatar asked Nov 01 '25 23:11

Juan Nolazco


2 Answers

Colaboratory comes with some non-base-Python packages "pre-installed"/already available for import. It doesn't include every single package however. For packages that aren't already included, like geopandas, you need to add a cell for installing the package:

% pip install geopandas

Run this cell before any cells where you want to import/use geopandas.

See also this SO thread (especially the answer by Doug Blank, a bit further down).

like image 140
datalowe Avatar answered Nov 04 '25 13:11

datalowe


Check if geopandas is installed

>>> import sys
>>> 'geopandas' in sys.modules

To install the released version, you can use pip (in Google Colab, do not forget to include character ! before pip):

!pip install geopandas

Here is the notebook with only installing Gdal, geopandas and descartes to work ploting and spatial join. Geopandas Colab

like image 37
Gautamrk Avatar answered Nov 04 '25 12:11

Gautamrk