2

Error installing Rasterio in PyCharm (Settings > Project Interpreter)

Collecting rasterio
  Using cached https://files.pythonhosted.org/packages/1a/d5/6cad936ff9beb89e79b1dae946f3097c70f7ab71cda5a9e356aec2e9ce9b/rasterio-1.0.8.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\X\AppData\Local\Temp\pycharm-packaging\rasterio\
You are using pip version 9.0.1, however version 18.1 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.

Same error when trying to install in command line; following is cmd line entry:

cd C:\Python27\ArcGIS10.6\Scripts
pip freeze
pip install rasterio

Here's the command line return:

Collecting rasterio
  Using cached https://files.pythonhosted.org/packages/1a/d5/6cad936ff9beb89e79b1dae946f3097c70f7ab71cda5a9e356aec2e9ce9b/rasterio-1.0.8.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\starb\appdata\local\temp\pip-install-dw_0ma\rasterio\

I can't find the gdal-config path. I guessed gdal-data and added that to Windows Environments, but no dice. I installed GDAL following these instructions: https://sandbox.idre.ucla.edu/sandbox/tutorials/installing-gdal-for-windows

  • First, I would use a standard installation of Python, rather than the ArcGIS install. Do you have QGIS installed on your machine, complete with the GDAL tools? – DPSSpatial Oct 11 '18 at 17:48
  • I would highly recommend using Anaconda to manage your Python environments and keep this separate from Arc's – mikewatt Oct 11 '18 at 18:22
  • @gberard, I'm only using python for ArcGIS work, so would I have to duplicate libraries then? (newbie) – AlexS1 Oct 11 '18 at 18:30
  • Yes, you'd have totally separate environments with a separate interpreter and everything. So for a given project you could use whatever version of Python with whatever version of a particular library. This is my preferred route, since Arc needs a specific version of certain libraries (e.g. numpy). If you update those trying to get other packages to work you can bork everything. I never got GDAL to fully install in Arc's environment back when I tired, FWIW. Basically if you need to use ArcPy then you're somewhat limited with what else you can install – mikewatt Oct 11 '18 at 22:04
  • I have the same issue, trying to install in non-ArcGIS python installation, any ideas how to install? – Symbionte May 2 at 20:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.