0

I am trying to install the geopandas package for Python. I have tried every installation process outlined by Geopandas here (I have tried literally every option they offer): https://geopandas.org/en/stable/getting_started/install.html. I finally thought I got it to work by creating a new environment (it appears the package is installed), however, when I try to import a shapefile I get an error. I have also searched through all the stack exchange answers on questions for downloading Geopandas and none of the solutions are working for me. See the code and error below. Can anyone help me download geopandas successfully?

I am running Python version 3.9.13, on Windows, using Spyder.

CODE:

import geopandas as gpd

# Set filepath
fp = "filepath.shp"

# Read file using gpd.read_file()
data = gpd.read_file(fp)

ERROR:

fp = "filepath.shp"

data = gpd.read_file(fp)
Traceback (most recent call last):

  Input In [3] in <cell line: 1>
    data = gpd.read_file(fp)

  File ~\Anaconda3\lib\site-packages\geopandas\io\file.py:81 in read_file
    if hasattr(features.crs, "to_dict"):

  File ~\Anaconda3\lib\site-packages\fiona\collection.py:214 in crs
    self._crs = self.session.get_crs()

  File fiona/ogrext.pyx:634 in fiona.ogrext.Session.get_crs

  File fiona/_err.pyx:259 in fiona._err.exc_wrap_pointer

CPLE_OpenFailedError: Unable to open EPSG support file gcs.csv.  Try setting the GDAL_DATA environment variable to point to the directory containing EPSG csv files.
  • The error explicitly says "CPLE_OpenFailedError: Unable to open EPSG support file gcs.csv. Try setting the GDAL_DATA environment variable to point to the directory containing EPSG csv files." Did you see if the install did download these files? – Parachute May 25 '22 at 18:06
  • I found the gcs.csv file in the following path: C:\Users\myuserid\Anaconda3\Library\share\gdal. How would I get it to point to this location? @Parachute – Lily Tromblay May 25 '22 at 18:46
  • when trying to do this with geopandas, this usually is a problem of conflicting base and env packages and dependencies. A clean install with miniconda (not anaconda) in a new env might help. see https://stackoverflow.com/a/72251100/3888719. – Michael Delgado May 25 '22 at 21:58

0 Answers0