2

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?

PolyGeo
65.5k29 gold badges115 silver badges350 bronze badges
asked Feb 3, 2024 at 10:04
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. Commented Feb 3, 2024 at 10:24

3 Answers 3

2

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
answered Feb 11, 2024 at 17:58
1

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.

answered Feb 11, 2024 at 17:14
1

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.

answered Feb 11, 2024 at 17:58

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.