Importerror:导入_gdal时DLL负载失败:未找到指定的过程

发布于 2025-02-07 18:43:06 字数 1273 浏览 0 评论 0原文

我正在尝试安装GDAL,并且我总是会收到此错误消息:Importerror:

DLL load failed while importing _gdal: The specified procedure was not found. 

我有Python 3.8.10(tags/v3.8.10:3d8993a,5月3日,5月3日2021,11:48:03)[MSC V.1928 64位(AMD64)]在Win32上 并使用轮子:GDAL-3.3.3-CP38-CP38-WIN_AMD64。

可以是我使用错误的车轮版本,如果是这样,我该如何找到合适的车轮? 在哪里可以找到车轮: /〜gohlke/pythonlibs/#gdal

我的代码:(

from asyncio.windows_events import NULL
from traceback import print_tb
from osgeo import gdal 
from numpy import meshgrid
from numpy import linspace

map = Basemap(projection='tmerc', 
              lat_0=0, lon_0=3,
              llcrnrlon=1.819757266426611, 
              llcrnrlat=41.583851612359275, 
              urcrnrlon=1.841589961763497, 
              urcrnrlat=41.598674173123)

ds = gdal.Open("C:/elevation.tif")
data = ds.ReadAsArray()

x = linspace(0, map.urcrnrx, data.shape[1])
y = linspace(0, map.urcrnry, data.shape[0])

xx, yy = meshgrid(x, y)

cs = map.contour(xx, yy, data, range(400, 1500, 100), cmap = plt.cm.cubehelix)
plt.clabel(cs, inline=True, fmt='%1.0f', fontsize=12, colors='k')

plt.show()

这是一个基础示例)

I am trying to install GDAL and I always get this error message: ImportError:

DLL load failed while importing _gdal: The specified procedure was not found. 

I have the Python 3.8.10 (tags/v3.8.10:3d8993a, May 3 2021, 11:48:03) [MSC v.1928 64 bit (AMD64)] on win32
and use the wheel: GDAL-3.3.3-cp38-cp38-win_amd64.whl

Can it be that I am using the wrong wheel version and if so how do I find the right one?
where you can finde the wheels: https://www.lfd.uci.edu/~gohlke/pythonlibs/#gdal

my code:

from asyncio.windows_events import NULL
from traceback import print_tb
from osgeo import gdal 
from numpy import meshgrid
from numpy import linspace

map = Basemap(projection='tmerc', 
              lat_0=0, lon_0=3,
              llcrnrlon=1.819757266426611, 
              llcrnrlat=41.583851612359275, 
              urcrnrlon=1.841589961763497, 
              urcrnrlat=41.598674173123)

ds = gdal.Open("C:/elevation.tif")
data = ds.ReadAsArray()

x = linspace(0, map.urcrnrx, data.shape[1])
y = linspace(0, map.urcrnry, data.shape[0])

xx, yy = meshgrid(x, y)

cs = map.contour(xx, yy, data, range(400, 1500, 100), cmap = plt.cm.cubehelix)
plt.clabel(cs, inline=True, fmt='%1.0f', fontsize=12, colors='k')

plt.show()

(this is a basemap example)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文