0

I am trying to import the GeoPandas module (which I had recently installed on my laptop) in a Jupyter notebook but it returning this error:

ModuleNotFoundError                       Traceback (most recent call last)
<ipython-input-1-a62d01c1d62e> in <module>
----> 1 import geopandas as gpd

ModuleNotFoundError: No module named 'geopandas'

I am certain that geopandas installed correctly. Can someone please suggest a fix?

Ricky_Nelson
  • 133
  • 1
  • 5

2 Answers2

1

It may not be installed in the right kernel for your jupyter notebook. One way to fix this is to run %pip install geopandas in a cell in your notebook. Then you can restart the kernel and you should be able to import it.

edit

just tried this out again and I had to add a --user to the magic command. The final command should look like %pip install geopandas --user

RohanP
  • 352
  • 1
  • 5
  • I tried that command and toward the end of it, the message this command returned read `Installing collected packages: munch, click-plugins, cligj, fiona, pyproj, geopandas Successfully installed click-plugins-1.1.1 cligj-0.5.0 fiona-1.8.13.post1 geopandas-0.7.0 munch-2.5.0 pyproj-2.6.0 Note: you may need to restart the kernel to use updated packages.` but I am still getting the same error as in my original question. Any suggestions for a fix? – Ricky_Nelson Apr 30 '20 at 17:01
  • Did you restart your kernel after? – RohanP Apr 30 '20 at 17:34
  • The original command worked for me after I restarted the kernel a couple times. Thanks! – Ricky_Nelson Apr 30 '20 at 20:06
0

For me, I had to manually install the libraries as i could not import them although they were present in pip list of installed packages.

I went to https://www.lfd.uci.edu/~gohlke/pythonlibs/, where I downloaded the compatible version for GDAL, Pyproj, Fiona, Shapely and Geopandas.

Then I manually installed them using:

pip install the file path