Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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 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.

like image 540
Recessive Avatar asked Feb 19 '19 05:02

Recessive


People also ask

What is Gdal config?

Description. This utility script (available on Unix systems) can be used to determine various information about a GDAL installation. It is normally just used by configure scripts for applications using GDAL but can be queried by an end user.

How do I download Fiona?

Windows. Binary installers are available at https://www.lfd.uci.edu/~gohlke/pythonlibs/#fiona and coming eventually to PyPI. You can download a binary distribution of GDAL from here. You will also need to download the compiled libraries and headers (include files).


1 Answers

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?

like image 163
ian leiper Avatar answered Sep 16 '22 17:09

ian leiper