简体   繁体   English

无法将gdal导入到安装了anaconda(MacOSX)的python中

[英]Unable import gdal into python installed with anaconda (MacOSX)

Getting the following when I try to import osgeo gdal on Mac. 当我尝试在Mac上导入osgeo gdal时获取以下内容。 I have installed gdal etc via anaconda. 我已经通过anaconda安装了gdal等。

>>> from osgeo import gdal
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/ste/anaconda/lib/python2.7/site-packages/osgeo/__init__.py", line 21, in <module>
_gdal = swig_import_helper()
File "/Users/ste/anaconda/lib/python2.7/site-packages/osgeo/__init__.py", line 17, in swig_import_helper
_mod = imp.load_module('_gdal', fp, pathname, description)
ImportError: dlopen(/Users/ste/anaconda/lib/python2.7/site- packages/osgeo/_gdal.so, 2): Library not loaded:  @loader_path/./libgssapi_krb5.2.2.dylib
Referenced from: /Users/ste/anaconda/lib/libgdal.20.dylib
Reason: image not found

Looks like krb5 is a dependency but not installed automatically by anaconda: 看起来krb5是一个依赖项但不是由anaconda自动安装的:

conda install krb5

This fix the problem for me! 这解决了我的问题!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM