简体   繁体   English

在诗歌项目上安装 GDAL

[英]Install GDAL on poetry project

I'm having trouble installing GDAL in a virtual environment managed by Poetry (working on an Ubuntu 18.04 distribution).我在 Poetry 管理的虚拟环境中安装 GDAL 时遇到问题(在 Ubuntu 18.04 发行版上工作)。

What I already found was:我已经发现的是:

  • this issue on poetry github's repo;这个问题在诗歌 github 的 repo 上; the pull request mentionned at the end seems to be stuck for now;最后提到的拉取请求现在似乎被卡住了;
  • one unanswered question on SO related to the gdal version configuration on poetry.关于诗歌的 gdal 版本配置的一个未回答的问题

For a "standard" installation, there are examples dealing with local paths using the "export" command.对于“标准”安装,有使用“导出”命令处理本地路径的示例

So far, I haven't found any working example on how to install GDAL in a poetry project.到目前为止,我还没有找到任何关于如何在诗歌项目中安装 GDAL 的工作示例。

Does anybody know how to handle this?有人知道如何处理吗? (or if this is possible at all?) (或者如果这是可能的?)

A workaround is to:一种解决方法是:

  1. run the shell (and start the virtual environment configured by poetry);运行shell(并启动诗歌配置的虚拟环境);
  2. proceed to install gdal using pip (beeing aware of the versions and needed option as stated here for instance);继续使用 pip 安装 gdal(例如,了解此处所述的版本和所需选项);
  3. exit the shell;退出 shell;
  4. proceed to mimic an new install through poetry ( poetry add gdal==XXX );继续通过诗歌模仿新装置( poetry add gdal==XXX );
  5. poetry should update the lock and toml files and conclude that no dependencies need to be installed or updated.诗歌应该更新 lock 和 toml 文件并得出不需要安装或更新依赖项的结论。

As I said this is a workaround (which needs to be referenced for now).正如我所说,这是一种解决方法(现在需要参考)。

I hope a better solution will emerge and will keep this "solution" unaccepted for a while...我希望会出现更好的解决方案,并让这个“解决方案”在一段时间内不被接受......

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM