Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Encountered a error while pip install rasterio

I am working on windows 10 and encountered an error while executing pip install rasterio in anaconda prompt.

(base) C:\Users\skywalker>pip install rasterio
Collecting rasterio
  Using cached https://files.pythonhosted.org/packages/57/84/be5689470a73f5f8988cf44b81cb3493ebb8abbbebb69768c8fc86fccdd5/rasterio-1.0.24.tar.gz
    Complete output from command python setup.py egg_info:
    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.

Command "python setup.py egg_info" failed with error code 1 in C:\Users\SKYWAL~1\AppData\Local\Temp\pip-install-iyhe142u\rasterio\
like image 233
Skywalker Avatar asked Jul 10 '19 03:07

Skywalker


People also ask

How do I import Rasterio into Python?

To install rasterio, simply download both binaries for your system (rasterio and GDAL) and run something like this from the downloads folder, adjusting for your Python version. You can also install rasterio with conda using Anaconda's conda-forge channel.

Does rasterio need gdal?

First, rasterio depends on gdal and if you've ever installed gdal for python (on Windows) you know it must be installed from a wheel file or compiled from source code. Second, rasterio must also be installed from a wheel file or compiled from source (see documentation here).


1 Answers

I solved this issue by following these steps:

pip install -U pip
pip install GDAL-1.11.2-cp27-none-win32.whl
pip install rasterio-0.24.0-cp27-none-win32.whl

Found in official docs

like image 113
Otto Avatar answered Oct 08 '22 03:10

Otto