1

This error raised while installing geopandas in vs code. I've looking for its solution on the web, but none of them really explain what happened and how to solve it..

Collecting geopandas
  Downloading geopandas-0.7.0-py2.py3-none-any.whl (928 kB)
     |████████████████████████████████| 928 kB 726 kB/s
Collecting shapely
  Downloading Shapely-1.7.0-cp38-cp38-win32.whl (895 kB)
     |████████████████████████████████| 895 kB 437 kB/s
Requirement already satisfied: pandas>=0.23.0 in c:\users\mayank\appdata\local\programs\python\python38-32\lib\site-packages (from geopandas) (1.0.3)
Collecting fiona
  Downloading Fiona-1.8.13.post1.tar.gz (1.2 MB)
     |████████████████████████████████| 1.2 MB 506 kB/s
    ERROR: Command errored out with exit status 1:
     command: 'C:\Users\mayank\AppData\Local\Programs\Python\Python38-32\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\mayank\\AppData\\Local\\Temp\\pip-install-1le2w4at\\fiona\\setup.py'"'"'; __file__='"'"'C:\\Users\\mayank\\AppData\\Local\\Temp\\pip-install-1le2w4at\\fiona\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base 'C:\Users\mayank\AppData\Local\Temp\pip-pip-egg-info-e_ca92eu'
         cwd: C:\Users\mayank\AppData\Local\Temp\pip-install-1le2w4at\fiona\
    Complete output (1 lines):
    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: python setup.py egg_info Check the logs for full command output.
mayank choudhary
  • 63
  • 1
  • 4
  • 12
  • on windows, you'll make your life a lot easier if you use conda to install your packages, specifically from the conda-forge channel (e.g., `conda create --name=gis python=3.7 geopandas rasterio descartes --channel=conda-forge`) – Paul H Jun 12 '20 at 14:30
  • 1
    but i don't have anaconda....Is there any solution rather than this?@PaulH – mayank choudhary Jun 13 '20 at 07:45
  • perhaps there is. but conda in free and makes setting up a GIS-based environment much much easier. – Paul H Jun 15 '20 at 14:17

2 Answers2

1

First you need to do is to install gdal package. I install it by pip with:

pip install https://download.lfd.uci.edu/pythonlibs/w4tscw6k/GDAL-3.2.2-cp39-cp39-win_amd64.whl

Tips: Do not install it directly through the normal pip usage: pip install gdal . You can find a compatible version of gdal for your python3.x Here.

After you have installed gdal, you can do that for fiona, Eg:

pip install https://download.lfd.uci.edu/pythonlibs/w4tscw6k/Fiona-1.8.18-cp39-cp39-win_amd64.whl

Finally, all of them can be installed successfully...

Mr_and_Mrs_D
  • 32,208
  • 39
  • 178
  • 361
Runstone
  • 368
  • 2
  • 8
-1

Fiona which is a dependency of geopandas requires a GDAL instance. When installing it needs looks to the PATH environment variable to find the GDAL location. If the PATH doesn't have a reference it fails to install. I found a work around is to grab the GDAL and fiona whl files and install from a local copy.