Skip to content Skip to sidebar Skip to footer

Provide A Path To Gdal-config Using A GDAL_CONFIG Environment Variable Error While Attempting To Install Fiona

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 var

Solution 1:

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/Fiona1.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?


Solution 2:

2 years later, but I thought I would share some insight into this question for anyone who happens on it.

I installed GDAL using https://trac.osgeo.org/osgeo4w/#QuickStartforOSGeo4WUsers. You don't need to install the osgeo GUI or anything, you can manually select what packages you want to install. Additionally it allows the easy install of a bunch of other useful related binaries that are used by many other packages (the one I specifically was having trouble with was cartopy).

After this, start adding things to your path envvar (for windows). For me, I added: C:\OSGeo4W64\bin and C:\OSGeo4W64\include to my path envvar and was able to get everything working after that. I could simply pip install at the command line with no issue.

This was done as an alternative to conda, as conda took 12 hours to tell me it couldn't install the package.


Post a Comment for "Provide A Path To Gdal-config Using A GDAL_CONFIG Environment Variable Error While Attempting To Install Fiona"