1

I have installed GDAL using conda and it installed successfully. But when I try

import gdal in jupyter notebook, it is showing this error.

---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
<ipython-input-25-ee38efafc30b> in <module>
----> 1 import gdal

~\Anaconda3\lib\site-packages\gdal.py in <module>
      1 # import osgeo.gdal as a convenience
----> 2 from osgeo.gdal import deprecation_warn
      3 deprecation_warn('gdal')
      4 
      5 from osgeo.gdal import *

ModuleNotFoundError: No module named 'osgeo'

and when I try from osgeo import gdal, it is showing this error:

---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
<ipython-input-26-61e0eefce4de> in <module>
----> 1 from osgeo import gdal

ModuleNotFoundError: No module named 'osgeo'

for GDAL installation i used this command:

conda install -c conda-forge gdal

version information

-- python 3.7
-- conda 4.7.5
-- gdal 2.3.3

How to solve this?

closed as off-topic by Vince, nmtoken, LaughU, J.R, whyzar Jul 9 at 13:55

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "This problem cannot or can no longer be reproduced. Changes to the system or to the asker's circumstances may have rendered the question obsolete, or the question does not include a procedure to enable potential answerers to reproduce the same symptoms. Such questions are off-topic as they are unlikely to help future readers, but editing them to include more details can lead to re-opening." – Vince, nmtoken, LaughU, J.R, whyzar
If this question can be reworded to fit the rules in the help center, please edit the question.

  • Have you tried "import gdal"? – bugmenot123 Jul 8 at 11:29
  • @bugmenot123 thanks for reply. I've sorted it out. Actually I had multiple python environments installed one in users and one in program data – Ramesh Raghavan Jul 8 at 14:18