在 Ubuntu 20.04 LTS 上使用 pip (python3) 更新 GDAL 时出错

发布于 2025-01-12 15:00:18 字数 1528 浏览 1 评论 0原文

我有一个 Linux 服务器 (Ubuntu 20.04 LTS),我正在尝试更新 GDAL。 以下所有内容均已用于更新软件包:

/usr/bin/python3 -m pip install --upgrade pip
/usr/bin/python3 -m pip install --upgrade wheel
/usr/bin/python3 -m pip install --upgrade setuptools

然后,检查 GDAL 版本:

gdal2tiles.py --version
GDAL 3.0.4, released 2020/01/28
Traceback (most recent call last):
  File "/usr/bin/gdal2tiles.py", line 2915, in <module>
    main()
  File "/usr/bin/gdal2tiles.py", line 2905, in main
    input_file, output_folder, options = process_args(argv[1:])
TypeError: 'NoneType' object is not subscriptable

我不确定为什么在显示版本时会出现这些错误。

无论如何,我使用以下命令尝试更新 GDAL,但在构建轮子时出现错误:

/usr/bin/python3 -m pip install --upgrade GDAL

错误:

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure

× Encountered error while trying to install package.
╰─> GDAL

      extensions/gdal_wrap.cpp:5573:13: warning: ‘CheckNumericDataType’ defined but not used [-Wunused-variable]
       5573 | static bool CheckNumericDataType(GDALExtendedDataTypeHS* dt)
            |             ^~~~~~~~~~~~~~~~~~~~
      error: command '/usr/bin/x86_64-linux-gnu-gcc' failed with exit code 1
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure

× Encountered error while trying to install package.
╰─> GDAL

I have a Linux Server (Ubuntu 20.04 LTS) and I am trying to update GDAL.
All below has been used to update packages:

/usr/bin/python3 -m pip install --upgrade pip
/usr/bin/python3 -m pip install --upgrade wheel
/usr/bin/python3 -m pip install --upgrade setuptools

Then, to check GDAL version:

gdal2tiles.py --version
GDAL 3.0.4, released 2020/01/28
Traceback (most recent call last):
  File "/usr/bin/gdal2tiles.py", line 2915, in <module>
    main()
  File "/usr/bin/gdal2tiles.py", line 2905, in main
    input_file, output_folder, options = process_args(argv[1:])
TypeError: 'NoneType' object is not subscriptable

I am not sure why those errors just when showing the version.

Anyhow, I use the following command to try to update GDAL and I get error about building the wheel:

/usr/bin/python3 -m pip install --upgrade GDAL

Errors:

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure

× Encountered error while trying to install package.
╰─> GDAL

      extensions/gdal_wrap.cpp:5573:13: warning: ‘CheckNumericDataType’ defined but not used [-Wunused-variable]
       5573 | static bool CheckNumericDataType(GDALExtendedDataTypeHS* dt)
            |             ^~~~~~~~~~~~~~~~~~~~
      error: command '/usr/bin/x86_64-linux-gnu-gcc' failed with exit code 1
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure

× Encountered error while trying to install package.
╰─> GDAL

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文