2016-11-20 51 views
2

我與麻煩導入`fiona`(OGR包裝器)和`geopandas`

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

裏面裝libgdallibnetcdffionageopandaskealib和一堆其他包的安裝geopandas

進口給了我一個衝突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

我剛剛在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 
>>> 
+1

謝謝!我可以確認它在乾淨的環境下工作。我也想知道如何修復我當前的環境(因爲我有其他我不想擦除的東西),所以如果你還可以添加一些關於它的想法,那將是很棒的。 – cd98