[gdal-dev] GDAL installation on Docker not working anymore

Matheus Cammarosano Hidalgo matheuschidalgo at gmail.com
Tue Sep 28 05:39:52 PDT 2021


I changed the Dockerfile following the same steps as the author of this
post (https://github.com/OSGeo/gdal/issues/4467) did to install GDAL (but
using version 2.2.3) and it worked fine. Still don't know why the way I did
previously is not working anymore but now everything is ok. Thank you!

Em seg., 27 de set. de 2021 às 11:38, Matheus Cammarosano Hidalgo <
matheuschidalgo at gmail.com> escreveu:

> The proposed solution applies to GDAL 3.0.4 going forward and I am working
> with 2.2.3. It is weird because I haven't changed anything in my
> Dockerfile...
>
> Em qui., 23 de set. de 2021 às 13:56, Even Rouault <
> even.rouault at spatialys.com> escreveu:
>
>> Perhaps related to https://github.com/OSGeo/gdal/issues/4467 ? where
>> upgrading setuptools was suggested
>> Le 23/09/2021 à 18:40, Matheus Cammarosano Hidalgo a écrit :
>>
>> I made a Dockerfile two years ago with a GDAL 2.2.3 install that was
>> working fine ultil three weeks ago, when I made a change in my Python code
>> (not Dockerfile), but when I tried to build the image I got an
>> error installing GDAL.
>> I am using a python:3.7 default image from Docker and I have the
>> following lines to install GDAL:
>> # Install GDAL dependencies
>> RUN apt-get install -y python3-pip libgdal-dev locales
>>
>> # Ensure locales configured correctly
>> RUN locale-gen en_US.UTF-8
>> ENV LC_ALL='en_US.utf8'
>>
>> # Set python aliases for python3
>> RUN echo 'alias python=python3' >> ~/.bashrc
>> RUN echo 'alias pip=pip3' >> ~/.bashrc
>>
>> # Update C env vars so compiler can find gdal
>> ENV CPLUS_INCLUDE_PATH=/usr/include/gdal
>> ENV C_INCLUDE_PATH=/usr/include/gdal
>>
>> RUN pip3 install GDAL==2.2.3
>>
>> When I try to build the image, I get the following error message:
>> ERROR: Command errored out with exit status 1: /usr/local/bin/python -u
>> -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] =
>> '"'"'/tmp/pip-install-9sbmiien/gdal_b1debd2d108d43f38c9919e931126904/setup.py'"'"';
>> __file__='"'"'/tmp/pip-install-9sbmiien/gdal_b1debd2d108d43f38c9919e931126904/setup.py'"'"';f
>> = getattr(tokenize, '"'"'open'"'"', open)(__file__) if
>> os.path.exists(__file__) else io.StringIO('"'"'from setuptools import
>> setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"',
>> '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))'
>> install --record /tmp/pip-record-sp2ip9vm/install-record.txt
>> --single-version-externally-managed --compile --install-headers
>> /usr/local/include/python3.7m/GDAL Check the logs for full command output.
>>
>> Does anyone know what is happening and some way to make the installation
>> work? Thank you!
>>
>> Best regards,
>> Matheus
>>
>> _______________________________________________
>> gdal-dev mailing listgdal-dev at lists.osgeo.orghttps://lists.osgeo.org/mailman/listinfo/gdal-dev
>>
>> -- http://www.spatialys.com
>> My software is free, but my time generally not.
>>
>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20210928/963a91ae/attachment.html>


More information about the gdal-dev mailing list