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?

有帮助吗?

解决方案

try installing gdal binaries with:

sudo pip install libgdal-dev

and fiona later on:

sudo pip install fiona

其他提示

If you are using homebrew on OSX:

Runbrew install gdal before running pip install fiona.

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

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top