Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

like image 945
tgrandje Avatar asked Oct 17 '25 17:10

tgrandje


1 Answers

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==X.X.X);
  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...

like image 180
tgrandje Avatar answered Oct 21 '25 03:10

tgrandje



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!