如何将GDAL降级到2.4版?

2024-10-03 06:30:40 发布

您现在位置:Python中文网/ 问答频道 /正文

我正试图在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安装gdal==2.4.3,但仍然无法工作

我无法获得正确的步骤来获得正确的版本。谁能给我指出正确的方向吗? 我用的是mac catalina


Tags: pipdjangopybuildconfig消息remote错误
1条回答
网友
1楼 · 发布于 2024-10-03 06:30:40

似乎此软件包的pip repo已损坏,无法正确安装软件包。我建议通过发行版的包管理器查看this page以进行安装。或者,您可以安装本地文件,如图所示here

相关问题 更多 >