Importerror:导入_gdal时DLL负载失败:未找到指定的过程
我正在尝试安装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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论