Windows安装GDAL库报错解决

直接安装报错如下,安装完C++生成工具后依然无法安装GDAL

pip install GDAL
Collecting GDAL
  Using cached GDAL-3.8.5.tar.gz (802 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Installing backend dependencies ... done
  Preparing metadata (pyproject.toml) ... done
Building wheels for collected packages: GDAL
  Building wheel for GDAL (pyproject.toml) ... error
  error: subprocess-exited-with-error

  × Building wheel for GDAL (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [135 lines of output]
      WARNING: numpy not available!  Array support will not be enabled
      running bdist_wheel
      running build
      running build_py
      creating build
    /Tpextensions/osr_wrap.cpp /Fobuild\temp.win-amd64-cpython-312\Release\extensions/osr_wrap.obj
      gnm_wrap.cpp
      gdal_wrap.cpp
      extensions/gdalconst_wrap.c(3013): fatal error C1083: 无法打开包括文件: “gdal.h”: No such file or directory
      ogr_wrap.cpp
      osr_wrap.cpp
      extensions/gnm_wrap.cpp(3153): fatal error C1083: 无法打开包括文件: “gdal.h”: No such file or directory
      extensions/gdal_wrap.cpp(3222): fatal error C1083: 无法打开包括文件: “cpl_port.h”: No such file or directory
      extensions/osr_wrap.cpp(3213): fatal error C1083: 无法打开包括文件: “cpl_string.h”: No such file or directory
      extensions/ogr_wrap.cpp(3181): fatal error C1083: 无法打开包括文件: “gdal.h”: No such file or directory
      error: command failed with exit code 2
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for GDAL
Failed to build GDAL
ERROR: Could not build wheels for GDAL, which is required to install pyproject.toml-based projects

安装
找了教程,但是下载地址已经失效。
之前的安装地址已经过期
Windows
可以在下面的链接进行下载
GDAL下载地址
在这里插入图片描述

下载对应python版本的 whl 格式的安装包,然后使用命令安装即可
pip install 下载文件名

pip install GDAL-3.8.4-cp312-cp312-win_amd64.whl

安装成功

评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

JavaOlS

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值