5

I have tried to install geopandas two different ways: pip install geopandas or by cloning

git clone https://github.com/kjordahl/geopandas

In both cases, the installation file setup.py runs for a while and then returns this error message:

src/fiona/ogrinit.c:300:23: fatal error: cpl_error.h: No such file or directory

compilation terminated.

error: command 'gcc' failed with exit status 1

fiona is interface to OGR so Python can read geospatial data. cpl_error.h seems to be missing. What can I do?

Glorfindel
  • 21,988
  • 13
  • 81
  • 109
john mangual
  • 7,718
  • 13
  • 56
  • 95

3 Answers3

3

try installing gdal dev binaries with:

sudo apt install libgdal-dev

and fiona later on:

sudo pip install fiona
Community
  • 1
  • 1
user1632928
  • 252
  • 1
  • 4
  • 14
0

If you are using homebrew on OSX:

Runbrew install gdal before running pip install fiona.

JesseBikman
  • 632
  • 1
  • 5
  • 22
0

Go to https://www.lfd.uci.edu/~gohlke/pythonlibs/#gdal and download the (fiona).whl file

pip install C:\Users\Downloads\Fiona-1.8.4-cp36-cp36m-win_amd64.whl

If you encounter error then read below

download the correct version of fiona else you will an error Fiona-1.8.4-cp36-cp36m-win_amd64.whl is not a supported wheel on this platform.**

to know which version is supported Use the below command in the python ide

**import pip._internal;**
**print(pip._internal.pep425tags.get_supported())**

output:- [('cp36', 'cp36m', 'win_amd64'), ('cp36', 'none', 'win_amd64'), ('py3', 'none', 'win_amd64'), ('cp36', 'none', 'any'), ('cp3', 'none', 'any'), ('py36', 'none', 'any'), ('py3', 'none', 'any'), ('py35', 'none', 'any'), ('py34', 'none', 'any'), ('py33', 'none', 'any'), ('py32', 'none', 'any'), ('py31', 'none', 'any'), ('py30', 'none', 'any'

choose the cp(version) which is mentioned in the output

Duck Dodgers
  • 3,409
  • 8
  • 29
  • 43