在 Ubuntu 20.04 LTS 上使用 pip (python3) 更新 GDAL 时出错
我有一个 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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论