0

I downloaded a shapefile from the Brazilian Institute of Geography and Statistics (IBGE). I can open it on QGIS and work with it perfectly there, but I need to work with it using Python.

I'm trying to open it with GeoPandas using the code line bellow:

shp_pr = gpd.read_file("data/PR/PR.shp")

But I get the following errors:

proj_create: Cannot find proj.db
proj_create: no database context specified
ERROR 4: Unable to open EPSG support file gcs.csv.  Try setting the GDAL_DATA environment variable to point to the directory containing EPSG csv files.
proj_create: Cannot find proj.db
proj_create: no database context specified
Unable to open EPSG support file gcs.csv.  Try setting the GDAL_DATA environment variable to point to the directory containing EPSG csv files.
proj_create: Cannot find proj.db
proj_create: no database context specified

I've also tried with GDAL, using these code lines:

from osgeo import ogr

driver = ogr.GetDriverByName("ESRI Shapefile")
ds = driver.Open("data/PR/PR.shp", 0) #open your shapefile

But I get these errors:

proj_create: Cannot find proj.db
proj_create: no database context specified
ERROR 4: Unable to open EPSG support file gcs.csv.  Try setting the GDAL_DATA environment variable to point to the directory containing EPSG csv files.
proj_create: Cannot find proj.db
proj_create: no database context specified
Unable to open EPSG support file gcs.csv.  Try setting the GDAL_DATA environment variable to point to the directory containing EPSG csv files.

I have all the ".cpg", ".dbf", ".prj", ".qpj", ".shp" and ".shx" files.

What is going wrong?

  • 1
    How did you install geopandas and its dependencies? – joris Jun 16 at 17:34
  • I used conda install -c conda-forge geopandas – nicoz Jun 16 at 20:40
  • Error message means that some support files which are needed by the proj library are not found. Did you set GDAL_DATA as adviced? – user30184 Jun 16 at 20:58
  • Sorry, but how do I do this? – nicoz Jun 16 at 22:31
  • Are you running this code from an activated conda environment or are you using an IDE and just pointing to the python interpreter in your conda environment? – user2856 Jun 17 at 6:12

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.