0

I'm looking to install GDAL for Python. The first thing I did is installing Python, then I install OSGeo including its library GDAL, then in CMD when I type pip install gdal I get this error

ERROR: Could not build wheels for GDAL, which is required to install pyproject.toml-based projects

then I tried to download the wheel required in this link https://www.lfd.uci.edu/~gohlke/pythonlibs/ but I didn't find it.

Does anyone know what could be the solution of my issue?

1
  • 1
    That page is no longer supported, but Christoph Gohlke has kindly opened an alternative for these binary wheels, I guess: cgohlke.com Please check and drop a line if it worked for you.
    – PDash
    Feb 3 at 10:24

3 Answers 3

0

I found the version I needed here: https://download.lfd.uci.edu/pythonlibs/archived/GDAL-3.4.3-cp311-cp311-win_amd64.whl

Note this needs Python 3.11 and it will not work with Python 3.12.

After downloading I placed the wheel file at the project root and installed it using pip.

0

An alternative option is to use the conda package/environment manager. You can

  1. install e.g. miniforge
  2. start the installed "Miniforge prompt"
  3. create a new environment with e.g. the name gdal with the command conda create --name gdal
  4. activate this new environment with conda activate gdal
  5. install gdal with: conda install gdal
0

If you already use OSGeo4W, just install its python-gdal package.

Otherwise you are mixing potentially (or rather, probably) incompatible packages.

Also, OSGeo4W comes with its own, isolated Python installation, so your installation of a system-wide Python did nothing useful if you are planning to use OSGeo4W.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.