Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using rasterio in Docker on a mac fails with "No such file or directory: 'gdal-config' #2801

Closed
28raining opened this issue Mar 31, 2023 · 2 comments

Comments

@28raining
Copy link

28raining commented Mar 31, 2023

Hi,

This is my docker file "Dockerfile":

FROM python:3.11.2-slim
RUN /usr/local/bin/python -m pip install --upgrade pip
RUN pip install rasterio

Also I've tried with Python 3.9.6

Which is built with this command:
docker build -t "name:Dockerfile" .

My docker version is:
Docker version 20.10.23, build 7155243

And I'm running macOS Ventura 13.3

Error message:

#6 11.79   Downloading rasterio-1.3.6.tar.gz (408 kB)
#6 11.83      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 408.5/408.5 kB 12.4 MB/s eta 0:00:00
#6 11.86   Installing build dependencies: started
#6 14.05   Installing build dependencies: finished with status 'done'
#6 14.05   Getting requirements to build wheel: started
#6 14.17   Getting requirements to build wheel: finished with status 'error'
#6 14.17   error: subprocess-exited-with-error
#6 14.17   
#6 14.17   × Getting requirements to build wheel did not run successfully.
#6 14.17   │ exit code: 1
#6 14.17   ╰─> [2 lines of output]
#6 14.17       WARNING:root:Failed to get options via gdal-config: [Errno 2] No such file or directory: 'gdal-config'
#6 14.17       ERROR: 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.
#6 14.17       [end of output]
@snowman2
Copy link
Member

Related: #2766

@vincentsarago
Copy link
Member

@28raining I guess you are running a New Mac OS M1. When using docker you'll create a Linux arm64, but rasterio do not provide python wheels for it yet (see rasterio/rasterio-wheels#69)

you can avoid the issue by setting --platform linux/amd64 in your docker run command or within the FROM statement (FROM --platform=linux/amd64 python:3.11.2-slim`

I'm going to close the issue for now but please feel free to re-open if you feel there is a bug in rasterio

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants