gpt4 book ai didi

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

转载 作者:太空宇宙 更新时间:2023-11-03 11:45:27 26 4
gpt4 key购买 nike

我安装了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

谢谢!

最佳答案

刚刚在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
>>>

关于python - 无法导入 `fiona`(OGR 包装器)和 `geopandas`,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40699463/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com