I'm working with docker and try to use the module rasterio
but I get the error No module named 'rasterio'
. In the requirements.txt of the docker image, rasterio is listed.
affine==2.3.1
anyio==3.5.0
attrs==21.4.0
certifi==2021.10.8
charset-normalizer==2.0.12
click==8.1.0
click-plugins==1.1.1
cligj==0.7.2
cycler==0.11.0
fonttools==4.31.2
h11==0.12.0
httpcore==0.14.7
httpx==0.22.0
idna==3.3
importlib-metadata==4.11.3
JPype1==1.3.0
kiwisolver==1.4.1
matplotlib==3.5.1
numpy==1.21.5
orhelper==0.1.3
packaging==21.3
pandas==1.3.5
Pillow==9.0.1
pyparsing==3.0.7
python-dateutil==2.8.2
python-dotenv==0.20.0
pytz==2022.1
rasterio==1.2.10
rfc3986==1.5.0
scipy==1.7.3
six==1.16.0
sniffio==1.2.0
snuggs==1.4.7
typing_extensions==4.1.1
xarray==0.20.0
zipp==3.7.0
If I try to install rasterio
with pip install rasterio
I get:
Requirement already satisfied: rasterio in /usr/local/lib/python3.8/dist-packages (1.2.10)
Requirement already satisfied: numpy in /usr/local/lib/python3.8/dist-packages (from rasterio) (1.21.5)
Requirement already satisfied: affine in /usr/local/lib/python3.8/dist-packages (from rasterio) (2.3.1)
Requirement already satisfied: snuggs>=1.4.1 in /usr/local/lib/python3.8/dist-packages (from rasterio) (1.4.7)
Requirement already satisfied: cligj>=0.5 in /usr/local/lib/python3.8/dist-packages (from rasterio) (0.7.2)
Requirement already satisfied: click-plugins in /usr/local/lib/python3.8/dist-packages (from rasterio) (1.1.1)
Requirement already satisfied: certifi in /usr/local/lib/python3.8/dist-packages (from rasterio) (2021.10.8)
Requirement already satisfied: click>=4.0 in /usr/local/lib/python3.8/dist-packages (from rasterio) (8.1.0)
Requirement already satisfied: setuptools in /usr/lib/python3/dist-packages (from rasterio) (45.2.0)
Requirement already satisfied: attrs in /usr/local/lib/python3.8/dist-packages (from rasterio) (21.4.0)
Requirement already satisfied: pyparsing>=2.1.6 in /usr/local/lib/python3.8/dist-packages (from snuggs>=1.4.1->rasterio) (3.0.7)
So I don't understand what's the problem. If I try to install rasterio
outside of the docker it doesen't work at all.
Collecting rasterio
Using cached rasterio-1.2.10.tar.gz (2.3 MB)
Installing build dependencies ... done
Getting requirements to build wheel ... error
ERROR: Command errored out with exit status 1:
command: 'C:\Users\felix\Anaconda3\python.exe' 'C:\Users\felix\Anaconda3\lib\site-packages\pip\_vendor\pep517\_in_process.py' get_requires_for_build_wheel 'C:\Users\felix\AppData\Local\Temp\tmp0fflsr94'
cwd: C:\Users\felix\AppData\Local\Temp\pip-install-owtmq2_l\rasterio
Complete output (2 lines):
INFO:root:Building on Windows requires extra options to setup.py to locate needed GDAL files. More information is available in the README.
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.
----------------------------------------
ERROR: Command errored out with exit status 1: 'C:\Users\felix\Anaconda3\python.exe' 'C:\Users\felix\Anaconda3\lib\site-packages\pip\_vendor\pep517\_in_process.py' get_requires_for_build_wheel 'C:\Users\felix\AppData\Local\Temp\tmp0fflsr94' Check the logs for full command output.
I don't know what GDAL
is and I'm afraid of braking stuff on my laptop. It happened before when I tried to install GDAL
.