question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Fiona 1.8.21 installation issues in Docker

See original GitHub issue

Expected behavior and actual behavior.

Fiona 1.8.21 fails to install on Docker using pip command. Actual resulting error:

Pip subprocess error:
    ERROR: Command errored out with exit status 1:
     command: /azureml-envs/azureml_7840fb85c0c6f77a3d0d23e7a62ca83b/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-8fumux68/fiona/setup.py'"'"'; __file__='"'"'/tmp/pip-install-8fumux68/fiona/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-m59wolxf
         cwd: /tmp/pip-install-8fumux68/fiona/
    Complete output (2 lines):
    Failed to get options via gdal-config: [Errno 2] No such file or directory: 'gdal-config'
    A GDAL API version must be specified. Provide a path to gdal-config using a GDAL_CONFIG environment variable or use a GDAL_VERSION environment variable.
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

Steps to reproduce the problem.

The reproduction steps are when Fiona is installed as part of an Azure ML inference script deployment. For this reason, I unfortunately can’t give a stripped down version of easy-to-follow steps.

Operating system

Docker image: mcr.microsoft.com/azureml/openmpi4.1.0-ubuntu20.04

Fiona and GDAL version and provenance

Fiona - 1.8.21 installed via pip GDAL - Not installed

Important notes

GDAL was never explicitly specified for installation and so it might seem obvious to add that to the pip installation file as well. That threw other errors (sorry, I don’t have them anymore), but what does work in installing Fiona 1.8.21 is to change my dockerfile from:

FROM mcr.microsoft.com/azureml/openmpi4.1.0-ubuntu20.04
RUN echo "test"

to:

FROM mcr.microsoft.com/azureml/openmpi4.1.0-ubuntu20.04
ENV DEBIAN_FRONTEND=noninteractive
RUN apt update && apt install -y libgdal-dev && rm -rf /var/lib/apt/lists/*
RUN export CPLUS_INCLUDE_PATH=/usr/include/gdal
RUN export C_INCLUDE_PATH=/usr/include/gdal

But this significantly slows down deployment time (doubles easily). Also, just using Fiona 1.8.20 works perfectly fine, without having to install GDAL explicitly.

Is there some problem with how Fiona 1.8.21 searches for the GDAL config in Docker?

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:11 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
sgilliescommented, Feb 10, 2022

@rbuffat interesting. I would expect Python 3.8 in an ubuntu 20.04 based system, so I’m surprised that you see 3.7 and @philsc sees 3.6.

0reactions
sgilliescommented, Feb 11, 2022

Update: I’ve uploaded 1.8.21 wheels for Python 3.6 to PyPI.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Docker build Fails when trying to install Fiona using python ...
The app requires geospatial packages like Geopandas, Folium, Shapely. When trying to build the Docker Image it fails when trying to install ......
Read more >
Fiona - PyPI
Installation. Fiona requires Python 2.7 or 3.4+ and GDAL/OGR 1.8+. To build from a source distribution you will need a C compiler and...
Read more >
Topics - main@fiona.groups.io
When we import fiona (1.8.21) into our python code in our cloud environment, ... to debug a problem I have while installing Fiona...
Read more >
Installing GeoPandas with Its Dependencies, without installing ...
Downloading Fiona-1.8.21.tar.gz (1.0 MB) ━━. Then you try installing gdal with pip install gdal and you get another error saying:
Read more >
Install Docker Engine on SLES
If you installed Docker using the convenience script, you should upgrade Docker using your package manager directly. There's no advantage to re-running the ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found