【发布时间】:2016-02-03 03:59:46
【问题描述】:
这个问题和我之前的两个问题有关:
Geospatial Analytics in Python
Installing geopandas on Python 2.6
我通过升级整个系统让 geopandas 工作。我没有让 Fiona 工作,以下是我尝试时遇到的错误
[root@sandbox ~]# pip install fiona
fiona/ogrext.c: In function ‘pyx_f_5fiona_6ogrext_14FeatureBuilder_build’:
fiona/ogrext.c:3255: warning: assignment discards qualifiers from pointer target type
fiona/ogrext.c: In function ‘pyx_pf_5fiona_6ogrext_7Session_4start’:
fiona/ogrext.c:8043: warning: implicit declaration of function ‘OGR_L_GetName’
fiona/ogrext.c:8043: warning: assignment makes pointer from integer without a cast
fiona/ogrext.c: In function ‘pyx_pf_5fiona_6ogrext_7Session_14get_driver’:
fiona/ogrext.c:8912: warning: assignment discards qualifiers from pointer target type
fiona/ogrext.c: In function ‘pyx_pf_5fiona_6ogrext_7Session_16get_schema’:
fiona/ogrext.c:9162: warning: assignment discards qualifiers from pointer target type
fiona/ogrext.c: In function ‘pyx_pf_5fiona_6ogrext_7Session_18get_crs’:
fiona/ogrext.c:10069: warning: assignment discards qualifiers from pointer target type
fiona/ogrext.c:10078: warning: assignment discards qualifiers from pointer target type
fiona/ogrext.c: In function ‘pyx_pf_5fiona_6ogrext_7Session_22get_extent’:
fiona/ogrext.c:11112: warning: passing argument 2 of ‘OGR_L_GetExtent’ from incompatible pointer type
/usr/include/gdal/ogr_api.h:324: note: expected ‘struct OGREnvelope *’ but argument is of type ‘struct pyx_t_5fiona_6ograpi_OGREnvelope *’
fiona/ogrext.c: In function ‘pyx_pf_5fiona_6ogrext_14WritingSession_start’:
fiona/ogrext.c:13233: warning: statement with no effect
fiona/ogrext.c:14390: warning: assignment makes pointer from integer without a cast
fiona/ogrext.c: In function ‘pyx_pf_5fiona_6ogrext_13_listlayers’:
fiona/ogrext.c:19743: warning: assignment makes pointer from integer without a cast
fiona/ogrext.c: In function ‘pyx_pf_5fiona_6ogrext_15buffer_to_virtual_file’:
fiona/ogrext.c:19866: error: ‘VSILFILE’ undeclared (first use in this function)
fiona/ogrext.c:19866: error: (Each undeclared identifier is reported only once
fiona/ogrext.c:19866: error: for each function it appears in.)
fiona/ogrext.c:19866: error: ‘pyx_v_vsi_handle’ undeclared (first use in this function)
error: command 'gcc' failed with exit status 1
----------------------------------------
Command "/usr/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip-build-oCUpd1/fiona/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-8szSWo-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-oCUpd1/fiona
【问题讨论】:
-
你安装了需求吗? “Fiona 需要 Python 2.6、2.7、3.3 或 3.4 和 GDAL/OGR 1.8+。要从源代码分发版构建,您将需要 C 编译器以及 GDAL 和 Python 开发头文件和库(用于 Debian/Ubuntu 的 libgdal1-dev , gdal-dev for CentOS/Fedora)."
-
@BurhanKhalid Python 2.6.6 python-devel-2.6.6-64.el6.x86_64 gdal-1.7.3-15.el6.x86_64 gcc 已安装(gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-16))有趣的是 - gdal.h - 我不知道它来自哪里,但它似乎是一个非常重要的文件。如此之多,yum search gdal* 给了我“警告:没有找到匹配项:gdal.h”。我还完成了 export CPLUS_INCLUDE_PATH=/usr/include/gdal 和 export C_INCLUDE_PATH=/usr/include/gdal 在编译之前包含所有标题
-
你需要安装 gdal-dev 这会给你 gdal.h;从您的输出中,您只安装了
gdal。您也有错误的版本(1.7),其中最低要求是 1.8 -
@BurhanKhalid pip install gdal-dev 给我
Collecting gdal-dev Could not find a version that satisfies the requirement gdal-dev (from versions: ) No matching distribution found for gdal-dev
标签: python geospatial geopandas fiona