tiger-sms ChatGPT 账号/ChatGPT 代注册 ChatGPT 账号/ChatGPT 代注册 OpenAI API 代充值

pip 安装 GDAL 包出现错误 ERROR: Command errored out with exit status 1 的解决方法

dajiaka OpenAI API key

最近老王需要安装 GDAL 包处理下 MODIS 遥感数据,结果在 PyCharm 中使用 pip 安装 GDAL 时,报错 ERROR: Command errored out with exit status 1,下面分享下这个错误的解决方法。

解决方法很简单,就是通过 whl 进行安装。

1、下载对应的 GDAL whl 文件

下载地址:https://www.lfd.uci.edu/~gohlke/pythonlibs/#gdal

GDAL whl 文件

例如老王是下载最新 3.3.3 版本的 GDAL,Python 版本是 Python3.8,则选择 GDAL‑3.3.3‑cp38‑cp38‑win_amd64.whl,其中 cp38 就是 Python 的版本。

2、pip 安装 whl 文件

直接通过 pip 安装 GDAL:

pip install C:\Users\1\Desktop\GDAL-3.3.3-cp38-cp38-win_amd64.whl

或者在 PyCharm 中安装 whl 文件:

import pip


def install_whl(path):
    pip.main(['install', path])


install_whl("C:\\Users\\1\\Desktop\\GDAL-3.3.3-cp38-cp38-win_amd64.whl")
赞(10)
关注我们
未经允许不得转载:老王博客 » pip 安装 GDAL 包出现错误 ERROR: Command errored out with exit status 1 的解决方法