Fiona 1.8.21 installation issues in Docker
See original GitHub issueExpected 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:
- Created 2 years ago
- Comments:11 (7 by maintainers)
Top GitHub Comments
@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.
Update: I’ve uploaded 1.8.21 wheels for Python 3.6 to PyPI.