简体   繁体   中英

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).

What I already found was:

  • this issue on poetry github's 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.

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.

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);
  2. proceed to install gdal using pip (beeing aware of the versions and needed option as stated here for instance);
  3. exit the shell;
  4. proceed to mimic an new install through poetry ( poetry add gdal==XXX );
  5. poetry should update the lock and toml files and conclude that no dependencies need to be installed or updated.

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...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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