alyse
alyse

Reputation: 43

gdal installed but not working in Jupyter Notebook

I installed gdal using conda install -c conda-forge gdal in my Jupyter terminal, but when I run the following code:

import gdal
gdal.Open('/Users/alyse/ldem.img') 
gdal.Translate('/Users/alyse/ldem.img')
mpimg.read('/Users/alyse/ldem.img')

I get the following error: ModuleNotFoundError: No module named 'gdal'.
welp. If anyone has any advice I would very much appreciate! I am a coding beginner.

Upvotes: 4

Views: 2862

Answers (2)

goduori
goduori

Reputation: 1

I did face a number of issues with gdal + jupyer notebooks. In the end, I created a virtual environment in Anaconda, conda install -c conda-forge gdal and all is working fine now.

Upvotes: 0

losted
losted

Reputation: 45

Try this: from osgeo import gdal, it worked for me.

Upvotes: 4

Related Questions