【问题标题】:how to downgrade GDAL to version 2.4?如何将GDAL降级到2.4版?
【发布时间】:2020-07-23 02:20:35
【问题描述】:

我正在尝试在 heroku 上推送我的 django 应用程序,但我不断收到此消息错误。

 An error occurred while installing gdal==3.1.2! Will try again.
remote:        Installing initially–failed dependencies…
remote:        Collecting gdal==3.1.2

...和

 Traceback (most recent call last):
remote:              File "/tmp/pip-build-oj843jp_/gdal/setup.py", line 257, in get_gdal_config
remote:                return fetch_config(option)
remote:              File "/tmp/pip-build-oj843jp_/gdal/setup.py", line 154, in fetch_config
remote:                raise gdal_config_error(e)
remote:            gdal_config_error: [Errno 2] No such file or directory: 'gdal-config'
remote:
remote:            Could not find gdal-config. Make sure you have installed the GDAL native library and development headers.

我认为这是因为我更新了 GDAL,因为之前的错误消息似乎 django 只支持 2.4 版。

我下载了 2.4.3 版本的文件,但找不到安装它的命令。 我试过 pip install gdal==2.4.3 还是不行。

我无法通过正确的步骤来获得正确的版本。谁能指出我正确的方向? 我正在使用 mac catalina

【问题讨论】:

  • 像你一样用 pip 指定版本是正确的做法。你得到什么错误?也可以使用pip -e在本地安装您下载的文件
  • 我在终端上收到了一些红色消息。害怕!! .错误:为 gdal 构建轮子失败为 gdal 运行 setup.py clean 无法构建 gdal 安装收集的包:gdal 尝试卸载:gdal 找到现有安装:GDAL 3.1.2 卸载 GDAL-3.1.2:成功卸载 GDAL-3.1.2 运行setup.py install for gdal ... error ERROR: Command errored out with exit status 1:
  • 不幸的是,有趣的部分就在您停止粘贴的位置,在“退出状态为 1:”之后。牛米,它是No such file or directory: 'gdal-config'。所以你没有安装libgdal-dev

标签: python django installation geospatial gdal


【解决方案1】:

似乎此软件包的 pip 存储库已损坏,并且未正确安装该软件包。我建议查看this page 以通过您的发行版的包管理器进行安装。或者,您可以按照here 指示安装本地文件

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2015-07-30
    • 2013-05-10
    • 2015-12-19
    • 2013-01-23
    • 2010-11-12
    • 2021-12-17
    • 2020-08-07
    • 1970-01-01
    相关资源
    最近更新 更多