简体   繁体   中英

Python3.8 GDAL Could not find gdal-config

Error

[enter image description here][1] [1]: https://i.stack.imgur.com/c3qQr.png

× Getting requirements to build wheel did not run successfully.
#8 17.82   │ exit code: 1
#8 17.82   ╰─> [2 lines of output]
#8 17.82       INFO:root:GDAL API version obtained from gdal-config: 2.4.0
#8 17.82       ERROR: GDAL >= 3.1 is required for rasterio. Please upgrade GDAL.
#8 17.82       [end of output]
#8 17.82   
#8 17.82   note: This error originates from a subprocess, and is likely not a problem with pip.
#8 17.82 error: subprocess-exited-with-error
#8 17.82 
#8 17.82 × Getting requirements to build wheel did not run successfully.
#8 17.82 │ exit code: 1
#8 17.82 ╰─> See above for output.
#8 17.82 
#8 17.82 note: This error originates from a subprocess, and is likely not a problem with pip.
#8 17.83 WARNING: You are using pip version 22.0.4; however, version 22.1.2 is available.
#8 17.83 You should consider upgrading via the '/usr/local/bin/python -m pip install --upgrade pip' command.

Fix GDAL & Python3.8

Module or Incorrect Python Version Problem?

file : dockerfile

FROM python:3.8.13-buster #by ubuntu only
RUN apt-get update && \
    apt-get install -y binutils libproj-dev gdal-bin ffmpeg libgdal-dev

COPY requirements.txt requirements.txt

RUN pip install -r requirements.txt

file : requirements.text

scikit-learn
geovoronoi
matplotlib
rasterio==1.2.0
affine==2.3.1
attrs==21.4.0
certifi==2022.6.15
click==7.1.2
click-plugins==1.1.1
cligj==0.7.2
Fiona==1.8.21
geopandas==0.11.0
munch==2.5.0
numpy==1.23.1
packaging==21.3
pandas==1.4.3
pyparsing==3.0.9
pyproj==3.3.1
python-dateutil==2.8.2
pytz==2022.1
Shapely==1.8.2
six==1.16.0
snuggs==1.4.7

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM