Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ERROR while importing GeoPandas in Python3 (Ubuntu); "Unable to open EPSG support file gcs.csv. (...)" #2500

Closed
swiss-knight opened this issue May 8, 2020 · 1 comment

Comments

@swiss-knight
Copy link
Contributor

swiss-knight commented May 8, 2020

Expected behavior and actual behavior.

I met the following error while importing geopandas in python3 on Ubuntu 18.04:

>>> import geopandas as gpd
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.

Notice; I installed GDAL using release 3.1.0 from github and the following procedure after having unzip the tar in a folder /opt/gdal-3.1.0:

cd /opt/gdal-3.1.0

./autogen.sh

./configure --enable-shared --with-python=python3 \
--with-proj=/usr/local CXXFLAGS="-Wall -std=c++11"

make

sudo checkinstall

sudo ldconfig

Checkinstall listed a few swig/python files that would not be embed in the dist package:

Some of the files created by the installation are inside the build
directory: /opt/gdal-3.1.0

You probably don't want them to be included in the package,
especially if they are inside your home directory.
Do you want me to list them?  [n]: y

/opt/gdal-3.1.0/swig/python/GDAL.egg-info/dependency_links.txt
/opt/gdal-3.1.0/swig/python/GDAL.egg-info/PKG-INFO
/opt/gdal-3.1.0/swig/python/GDAL.egg-info/requires.txt
/opt/gdal-3.1.0/swig/python/GDAL.egg-info/SOURCES.txt
/opt/gdal-3.1.0/swig/python/GDAL.egg-info/top_level.txt
/opt/gdal-3.1.0/swig/python/record.txt

Should I exclude them from the package? (Saying yes is a good idea)  [y]:  y

After what, I installed gdal in Python3 using pip:

sudo -h pip3 install -U gdal
It went fine, without any errors.

Environment

OS: Ubuntu 18.04.

Python3: Python 3.6.9 (default, Apr 18 2020, 01:56:04)

gdalinfo --version: GDAL 3.1.0, released 2020/05/03

geopandas:

>>> import geopandas as gpd
>>> gpd.__version__
'0.7.0'

gdal (python):

>>> from osgeo import gdal
>>> gdal.__version__
'3.1.0'
>>> gdal.__file__
'/usr/local/lib/python3.6/dist-packages/osgeo/gdal.py'

This may be useful (these files are certainly unrelated to the current installation):

$ sudo find /usr -iname gcs.csv
./share/gdal/2.4/gcs.csv
./share/epsg_csv/gcs.csv
./local/lib/python3.6/dist-packages/rasterio/gdal_data/gcs.csv
./local/lib/python3.6/dist-packages/fiona/gdal_data/gcs.csv

And this led to no results:

$ sudo find /opt -iname gcs.csv

I wonder what this file is and if there is something that should have been done during the installation for it to be aware of this file gcs.csv?

@rouault
Copy link
Member

rouault commented May 8, 2020

Looks like you have a mix of GDAL versions in your environemnt. gcs.csv is no longer used since GDAL 3.0.

@rouault rouault closed this as completed May 8, 2020
@swiss-knight swiss-knight changed the title While simply importing GeoPandas in Python3; "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" ERROR while importing GeoPandas in Python3 (Ubuntu); "Unable to open EPSG support file gcs.csv. (...)" May 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants