Skip to content Skip to sidebar Skip to footer

Having Trouble Installing Gdal For Python

Let me start by saying that I have searched for help this problem and gone through the numerous threads that I have found, and none of them have worked, or I wasn't able to underst

Solution 1:

Probably the easiest way to install such kind of libraries is conda. Get and install Miniconda as user, not root. Now, create a new environment and install gdal into it:

conda create -n gdal_test python=3.5
activate gdal_test
conda install gdal

You need to stay inside this shell window. i.e. th prompt should like this (gdal_test). Start Python:

python
>>>import gdal

Note: On Linux and Mac OS X use source activate gdal_test.

To find out what versions of gdal are available, type:

conda search gdal

An output like this:

gdal

      ....
               2.0.0               np110py34_0  defaults

means gdal 2.0.0 is available for Python 3.4 and needs NumPy 1.10.

Solution 2:

On Windows the easiest way to install GDAL is to use pre-built binaries unless you have special needs that require building GDAL from source. Apart from conda, as mentioned by @Mike Müller, there are three common sources for GDAL Windows binaries (with Python bindings):

Solution 3:

To install GDAL on windows, you need to follow the below-mentioned step: -

  1. You need to install GDAL wheel file using the link https://www.lfd.uci.edu/~gohlke/pythonlibs/#gdal . After visiting this link, download this file named "GDAL‑3.0.4‑cp37‑cp37m‑win32.whl" since it worked for me and then use the command "pip install c:\Users........\GDAL‑3.0.4‑cp37‑cp37m‑win32.whl" to successfully install GDAL which is the requirement of Geopandas.

NOTE: If the above-mentioned wheel file doesn't work for you, then try using alternate wheel files.

Post a Comment for "Having Trouble Installing Gdal For Python"