19

I am trying to install fiona and geopandas on a mac machine.

I have installed GDAL trough brew install gdal --HEAD

If I try install fiona, I get the following:

sudo pip3 install fiona
Collecting fiona
  Downloading Fiona-1.8.18.tar.gz (1.3 MB)
     |████████████████████████████████| 1.3 MB 4.7 MB/s 
    ERROR: Command errored out with exit status 1:
     command: /usr/local/opt/python@3.9/bin/python3.9 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/tmp/pip-install-sk0rqerp/fiona_e389978ed5a44635a5158a0ba3df8562/setup.py'"'"'; __file__='"'"'/private/tmp/pip-install-sk0rqerp/fiona_e389978ed5a44635a5158a0ba3df8562/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /private/tmp/pip-pip-egg-info-bngdnoq7
         cwd: /private/tmp/pip-install-sk0rqerp/fiona_e389978ed5a44635a5158a0ba3df8562/
    Complete output (2 lines):
    Failed to get options via gdal-config: [Errno 2] No such file or directory: 'gdal-config'
    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.
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
emax
  • 6,965
  • 19
  • 74
  • 141
  • What output do you get doing `gdal-config --version`? Make sure gdal is in your PATH. – Shunya Jan 14 '21 at 09:11
  • @Shunya I get `gdal-config --version` `-bash: gdal-config: command not found` – emax Jan 14 '21 at 09:14
  • @emax can you run the binary from `/usr/local/bin/gdal-config`? if so, try opening a new terminal and/or checking to see if `/usr/local/bin` is in in the output of `echo $PATH` – vlsd Jan 20 '21 at 15:23
  • 1
    I also tried to install gdal via homebrew, but it looks like the brew logs show a bunch of 403 errors and SHA mismatches, so it didn't actually install properly, which is why the binary is coming up as `command not found` when we try to run it. Seems brew is having issues installing this package right now. – Hartley Brody Jul 05 '21 at 19:41
  • 3
    I was indeed able to solve this with a simple `brew install gdal` and could install `fiona` and `geopandas`. – Tobias Pfandzelter Mar 02 '22 at 10:02

1 Answers1

7

This problem occured for me when trying to install geopandas on a M1 Mac (using the command pip3 install geopandas)

Using homebrew package manager, install the gdal package:

brew install gdal

Then try again installing the failed pip install:

pip3 install geopandas

moo
  • 1,597
  • 1
  • 14
  • 29