【问题标题】:Error with GDAL python binding in GeoDjango ShellGeoDjango Shell中的GDAL python绑定错误
【发布时间】:2013-03-21 18:46:39
【问题描述】:

我想在我的 GeoDjango 站点中使用 GDAL python 绑定。这样做的目的是在脚本中使用 ogr2ogr 功能。我在windows 7上所以我安装了GDAL-1.9.2.win32-py2.7下载here

安装正确。我可以在 python 中导入 GDAL:from osgeo import GDAL

但是,在我的 geodjango 应用程序 python shell 中,当我尝试导入 osgeo 时出现错误。错误如下:

>>> import osgeo
Traceback (most recent call last):
  File "<console>", line 1, in <module>
  File "C:\Python27\lib\site-packages\osgeo\__init__.py", line 21, in
_gdal = swig_import_helper()
  File "C:\Python27\lib\site-packages\osgeo\__init__.py", line 17, in
t_helper_mod = imp.load_module('_gdal', fp, pathname, description)
 ImportError: DLL load failed: La procÚdure spÚcifiÚe est introuvable.
>>>

有人可以帮我解决这个问题吗?

我正在使用 GeoDjango v. 1.4.3 |蟒蛇2.7.3 | GDAL 1.9.2 win32

【问题讨论】:

    标签: python geodjango gdal


    【解决方案1】:

    仅安装 python 绑定不提供对 GDAL 的访问。几年前有一个short blog 可能会有所帮助。

    简而言之,您需要前往 gisinternals 并下载 GDAL。然后你应该有一个 GDAL 的工作安装,从中 from osgeo import gdal 可以工作。

    【讨论】:

      猜你喜欢
      • 2012-02-24
      • 1970-01-01
      • 1970-01-01
      • 2017-06-30
      • 1970-01-01
      • 2022-10-18
      • 1970-01-01
      • 1970-01-01
      • 2018-02-28
      相关资源
      最近更新 更多