Reputation: 83
GDAL 3.2.0, released 2020/10/26
ModuleNotFoundError Traceback (most recent call last)
In [5]:
Line 1: import gdal
ModuleNotFoundError: No module named 'gdal'
Can anyone help me? Thanks!
Upvotes: 2
Views: 6111
Reputation: 77
Have you try from osgeo import gdal
?
This command works in my case, because the gdal package is installed as a sub-module of osgeo, rather than a stand-alone package.
Upvotes: 2
Reputation: 475
export PYTHONPATH=$PYTHONPATH:yourDirectoryPath
(This was the installation note I kept for my older version of Python2 on the old Mac when it couldn't find the module)
One thing to note, the Python3 brew installed is different with Mac's built in python3, and lives in a different path, and gdal is supposed to link with this brew installed Python3, so, make sure your JupyterLab PYTHONPATH is pointed to the brew Python3.9 directory.
Upvotes: 0