Not able to install the gdal module of python

24 Views Asked by At

pip installed both gdal and osgeo modules, yet im getting an issue as shown. gdal terminal installation error osgeo terminal installation error

How do I go past this? Note - Had recently installed anaconda on my system since, I am having trouble with installation of certain modules.

First off tried pip installing both to my main folder and ran the code but it showed osgeo/gdal module missing. After that made a new env and now the errors are shown above.

1

There are 1 best solutions below

0
Rafa On

First you need to install the GDAL libraries:

sudo add-apt-repository ppa:ubuntugis/ppa
sudo apt-get update
sudo apt-get install gdal-bin
sudo apt-get install libgdal-dev

Second, install the same version from PIP to match your installation. You can check the version by typing gdalinfo --version in your terminal. For example, if you get 3.7.1, you need to run pip install GDAL==3.7.1.