Reputation: 31
I have an issue in importing gdal in Python 3.9.4.
I installed "gdal-302-1928-x64-core.msi" and "GDAL-3.2.1.win-amd64-py3.6.msi" taken from https://gisinternals.com/query.html?content=filelist&file=release-1928-x64-gdal-3-2-1-mapserver-7-6-2.zip
I also installed "GDAL-3.2.2-cp39-cp39-win_amd64.whl" taken from https://www.lfd.uci.edu/~gohlke/pythonlibs/
When I tried to import it, it looks like this: click this
It says:
Traceback (most recent call last): File stdin, line 1, in module. ModuleNotFoundError: No module named 'gdal'
For setting environmental & system variables, I've managed it well, but still not helping me. Probably I should install "GDAL-3.2.2.win-amd64-py3.9.msi" but I don't find it in https://gisinternals.com/
Could someone help me? Thank you.
Regards, Arfah
Upvotes: 2
Views: 1656
Reputation: 31
Always download packages suitable to the Python version you are using. Yes correctly:"GDAL-3.2.2.win-amd64-py3.9.msi" should be installed,and by doing so automatically the osgeo along with teh egg-info package will be installed in $PYTHONPATH/Lib/site-packages/.
To correct the error, you should use:
from osgeo import gdal
Upvotes: 3