Provide a path to gdal-config using a GDAL_CONFIG environment variable error while attempting to install Fiona

Recessive picture Recessive · Feb 19, 2019 · Viewed 13.3k times · Source

This is the error I receive:

A GDAL API version must be specified. Provide a path to gdal-config using a GDAL_CONFIG environment variable or use a GDAL_VERSION environment variable.

after running the command:

pip install Fiona

from the command line. I had to install GDAL manually from a wheel file found here (python 3.7 32bit): https://www.lfd.uci.edu/~gohlke/pythonlibs/#gdal

I have looked for a solution to this but the suggested solution is to uninstall and reinstall GDAL through Conda, and I am unable to use Conda.

If anyone could tell me simply where the gdal-config file is that would be fantastic so I can add it to my environment variables. A solution is also very welcome.

Answer

ian leiper picture ian leiper · Feb 20, 2019

This doesn't show where the gdal-config file is, but solves your fiona issue.

First download the relevant wheel file (looks like Fiona‑1.8.4‑cp37‑cp37m‑win32.whl is what you're after and it's available at the site you linked: https://www.lfd.uci.edu/~gohlke/pythonlibs/#fiona).

Then use this command (changing the path to where you file is):

pip install C:/path/to/Fiona‑1.8.4‑cp37‑cp37m‑win32.whl

More info here: https://pip.pypa.io/en/latest/user_guide/#installing-from-wheels and How do I install a Python package with a .whl file?