无法导入`fiona`(OGR包装器)和`geopandas`

时间:2016-11-20 00:38:31

标签: python anaconda conda geopandas

我使用

安装了geopandas
conda install --channel https://conda.anaconda.org/conda-forge geopandas

安装了libgdallibnetcdffionageopandaskealib以及其他一些软件包。

导入让我与libnetcdf发生冲突,所以我尝试了:

conda install libnetcdf

原始错误消失了,但现在当我尝试导入geopandas时,fiona要求会出错。这是追溯:

/Users/username/anaconda3/lib/python3.5/site-packages/fiona/collection.py in <module>()
      6 
      7 from fiona import compat
----> 8 from fiona.ogrext import Iterator, ItemsIterator, KeysIterator
      9 from fiona.ogrext import Session, WritingSession
     10 from fiona.ogrext import (

ImportError: dlopen(/Users/username/anaconda3/lib/python3.5/site-packages/fiona/ogrext.cpython-35m-darwin.so, 2): Symbol not found: __ZN2H56H5FileC1ERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEjRKNS_17FileCreatPropListERKNS_15FileAccPropListE
  Referenced from: /Users/username/anaconda3/lib//libkea.1.4.6.dylib
  Expected in: /Users/username/anaconda3/lib//libhdf5_cpp.12.dylib
 in /Users/username/anaconda3/lib//libkea.1.4.6.dylib

谢谢!

1 个答案:

答案 0 :(得分:1)

我刚刚在python 3.5 conda环境中测试过并没有问题。您可能会发现它与您的环境进行比较很有帮助。

 ➜  ~ conda create -n geopandas_test_env python=3.5
 ➜  ~ source activate geopandas_test_env
 ➜  ~ conda install -c conda-forge geopandas


(testtest) ➜  ~ conda install -c conda-forge geopandas

click:           6.6-py35_1         conda-forge
click-plugins:   1.0.3-py35_0       conda-forge
cligj:           0.4.0-py35_0
curl:            7.49.1-1           conda-forge
cycler:          0.10.0-py35_0      conda-forge
descartes:       1.0.2-py35_0       conda-forge
expat:           2.1.0-2            conda-forge
fiona:           1.7.1-np111py35_0  conda-forge
freetype:        2.6.3-1            conda-forge
freexl:          1.0.2-1            conda-forge
gdal:            2.1.2-np111py35_2  conda-forge
geopandas:       0.2.1-py35_2       conda-forge
geos:            3.5.1-1            conda-forge
giflib:          5.1.4-0            conda-forge
hdf4:            4.2.12-0           conda-forge
hdf5:            1.8.17-7           conda-forge
icu:             56.1-4             conda-forge
jpeg:            9b-0               conda-forge
json-c:          0.12-0             conda-forge
kealib:          1.4.6-3            conda-forge
libdap4:         3.18.2-0           conda-forge
libgfortran:     3.0.0-0            conda-forge
libiconv:        1.14-3             conda-forge
libnetcdf:       4.4.1-0            conda-forge
libpng:          1.6.26-0           conda-forge
libpq:           9.5.4-3            conda-forge
libspatialindex: 1.8.5-1            conda-forge
libspatialite:   4.3.0a-13          conda-forge
libtiff:         4.0.6-7            conda-forge
libxml2:         2.9.3-9            conda-forge
matplotlib:      1.5.3-np111py35_2  conda-forge
mkl:             11.3.3-0
munch:           2.0.4-py35_0       conda-forge
numpy:           1.11.2-py35_0
openjpeg:        2.1.2-1            conda-forge
pandas:          0.19.1-np111py35_0 conda-forge
proj4:           4.9.3-0            conda-forge
psycopg2:        2.6.2-py35_1       conda-forge
pyparsing:       2.1.10-py35_0      conda-forge
pyproj:          1.9.5.1-py35_0     conda-forge
pysal:           1.12.0-py35_0      conda-forge
python-dateutil: 2.6.0-py35_0       conda-forge
pytz:            2016.7-py35_0      conda-forge
rtree:           0.8.2-py35_0       conda-forge
scipy:           0.18.1-np111py35_0
shapely:         1.5.17-np111py35_1 conda-forge
six:             1.10.0-py35_0      conda-forge
sqlalchemy:      1.1.4-py35_0
xerces-c:        3.1.4-2            conda-forge

(testtest) ➜  ~ python
Python 3.5.2 |Continuum Analytics, Inc.| (default, Jul  2 2016,     17:52:12)
[GCC 4.2.1 Compatible Apple LLVM 4.2 (clang-425.0.28)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import geopandas as gp
>>>