Window安装GDAL绑定Python

发布时间 2023-07-24 17:47:22作者: 槑孒

Window安装GDAL

在安装完GDAL后,来绑定Python(我安装的是Python10)

下载osgeo库

下载whl

GDAL‑3.4.3‑cp310‑cp310‑win_amd64.whl为例。

下载至D:\APP\Develop\Python\Python310\Scripts(一个电脑系统环境变量里有设置过的路径就行)

安装osgeo库

在该文件路径下打开命令行窗口,执行命令

pip install GDAL‑3.4.3‑cp310‑cp310‑win_amd64.whl

如果报is not a supported wheel on this platform错误就表示python版本和GDAL版本不一致导致的。

可以直接使用了

from osgeo import ogr
...