Attempting to find version of GDAL installed


Orry Messer
 

Good day,

 

I am attempting to debug a problem I have while installing Fiona within a Docker container. Apologies if my understanding is a bit shaky – I’m very new to this.

Essentially, I am trying to understand the relationship between GDAL and Fiona. It stems from a problem to do with specifying GDAL API version in a fresh install (either by using gdal-config or GDAL_CONFIG environment variable).

I currently have a working container, with Fiona installed. However, I do not understand how it got to this state.

When I import Fiona in python, 

>>> import fiona

And then run 

>>> fiona.gdal_version

I get: GDALVersion(major=2, minor=3, revision=2).

To me, it seems that GDAL is installed within this container. However, I cannot find it anywhere in this container. Is there a way to ascertain the path Fiona is pointing to?

 

Thanks,

Orry

 


Sean Gillies
 

Hi Orry,

No need to apologise for asking, the fiona and GDAL software stack is complicated. 

The fiona packages on PyPI include their own copies of GDAL and its dependencies, so you may be detecting that one. One way to know for sure is to use (on Linux) the LD_DEBUG environment variable.

LD_DEBUG=all python -c "import fiona"

will dump a wall of text into your terminal and if you scan it for libgdal, you'll see the path of the shared library that fiona links.


On Thu, Mar 4, 2021, 7:27 AM Orry Messer <orry@...> wrote:

Good day,

 

I am attempting to debug a problem I have while installing Fiona within a Docker container. Apologies if my understanding is a bit shaky – I’m very new to this.

Essentially, I am trying to understand the relationship between GDAL and Fiona. It stems from a problem to do with specifying GDAL API version in a fresh install (either by using gdal-config or GDAL_CONFIG environment variable).

I currently have a working container, with Fiona installed. However, I do not understand how it got to this state.

When I import Fiona in python, 

>>> import fiona

And then run 

>>> fiona.gdal_version

I get: GDALVersion(major=2, minor=3, revision=2).

To me, it seems that GDAL is installed within this container. However, I cannot find it anywhere in this container. Is there a way to ascertain the path Fiona is pointing to?

 

Thanks,

Orry

 


Orry Messer
 

Thanks Sean!

Well, it appears that the libgdal shared library which fiona is linking resides in /usr/local/lib/python3.6/site-packages/fiona/.libs, rather than /usr/lib or /usr/local/lib - which leads me to believe that fiona has obtained its GDAL dependencies from PyPI. 

What I am struggling with, is that locally, on my dev machine, fiona does not seem to be getting GDAL dependencies from PyPI, where as on my CI/CD server, it is getting its dependencies and so the result of "pip install fiona" works. Do you have any idea why this may be the case?

- Orry


René Buffat
 

Not sure if related, but there seems to be no macos wheel for python 3.9 on pypi: https://pypi.org/project/Fiona/#files


Sean Gillies
 

We provide wheel distributions for only a small group of platform tags and Python versions. See https://pypi.org/project/Fiona/1.8.18/#files. I suspect your CI/CD server's pip program finds a compatible wheel, but your dev machine cannot. In that case, pip on your dev machine will take the source distribution, the .tar.gz file.


On Mon, Mar 8, 2021, 12:44 AM Orry Messer <orry@...> wrote:
Thanks Sean!

Well, it appears that the libgdal shared library which fiona is linking resides in /usr/local/lib/python3.6/site-packages/fiona/.libs, rather than /usr/lib or /usr/local/lib - which leads me to believe that fiona has obtained its GDAL dependencies from PyPI. 

What I am struggling with, is that locally, on my dev machine, fiona does not seem to be getting GDAL dependencies from PyPI, where as on my CI/CD server, it is getting its dependencies and so the result of "pip install fiona" works. Do you have any idea why this may be the case?

- Orry


Orry Messer
 

Yeah, I believe this is what has happened. On the CI/CD server, a whl was used, and locally it's using the source .tar.gz.

Thanks again.