Provide a path to gdal-config using a GDAL_CONFIG environment variable error while attempting to install mapbox-tileset
Asked Answered
L

1

6

when running pip install mapbox-tilesets I get the following error on my windows 10 computer during the Collecting rasterio process specifically the requirement to build wheel where I get the error. Details below.

Collecting rasterio
  Using cached rasterio-1.1.8.tar.gz (2.1 MB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... error
  ERROR: Command errored out with exit status 1:
   command: 'C:\Users\Sandy Haaf\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\python.exe' 'C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.2032.0_x64__qbz5n2kfra8p0\lib\site-packages\pip\_vendor\pep517\_in_process.py' get_requires_for_build_wheel 'C:\Users\Sandy Haaf\AppData\Local\Temp\tmp5nhr9kl_'
       cwd: C:\Users\Sandy Haaf\AppData\Local\Temp\pip-install-gj86e2z4\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\Sandy Haaf\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\python.exe' 'C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.2032.0_x64__qbz5n2kfra8p0\lib\site-packages\pip\_vendor\pep517\_in_process.py' get_requires_for_build_wheel 'C:\Users\Sandy Haaf\AppData\Local\Temp\tmp5nhr9kl_' Check the logs for full command output.
WARNING: You are using pip version 20.2.3; however, version 20.3.3 is available.
You should consider upgrading via the 'C:\Users\Sandy Haaf\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\python.exe -m pip install --upgrade pip' command.

I cannot locate a gdal-config file, so am unable to provide the path to a GDAL-CONFIG environment variable.

C:\>gdalinfo --version
GDAL 3.1.4, released 2020/10/20

C:\>python --version 
Python 3.8.7

I have reinstalled gdal using http://download.osgeo.org/osgeo4w/osgeo4w-setup-x86_64.exe

I've also added c:\OSGeo4W64\bin to both the Path and GDAL_DATA environment variables. I tried adding it to GDAL_CONFIG too but it didn't help.

Any help would be appreciated. Thanks!!

Loads answered 11/1, 2021 at 19:32 Comment(0)
R
0

Don't know if this will help here, but I used conda to install rasterio first:

conda install -c conda-forge rasterio

Then pip install mapbox-tilesets worked fine. In general, conda seems to work better for installing spatial packages (e.g. geopandas) for exactly this reason.

Ricer answered 19/10, 2021 at 17:59 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.