2

Is there a way to tweak the fiona/gdal/osgeo packages installed through Anaconda so that they can be used to read/write GDB files using the ESRI FileGDB driver?

I have found multiple answers online, but all of them involve re-installing OSGeo or GDAL from the python wheel files. These methods do not work for me because I installed fiona, OSGeo and GDAL using Anaconda. So none the solutions I found online (listed below) seem to work.

I have already downloaded the DLL file from ESRI, placed it in my C:\...\Lib\site-packages\osgeo folder and added a new environment variable called GDAL_DRIVER_PATH indicating the appropriate path. However, contrary to the suggestions in the posts listed below, the __init__.py inside the osgeo folder does not have a commented line that reads os.environ['GDAL_DRIVER_PATH'] = os.path.join(os.path.dirname(__file__), 'gdalplugins'). Therefore, I am not sure where to include this line in my own file system.

Here is a list of related posts/questions/sites with relevant info but which ultimately did not solve my problem.

How I installed Fiona and other packages:

I'm currently using Windows 10. After installing Anaconda, I created a new environment called myenv and installed the main libraries I was going to use:

conda create -n myenv pandas geopandas fiona spyder numpy scipy

GDAL was automatically installed as one of the associated/required packages for fiona and geopandas.

In my command prompt, when I activate myenv and type gdalinfo --version, I get the following response:

GDAL 3.0.2, released 2019/10/28

When I use the python-based route, I get the same answer.

import osgeo.gdal
print(osgeo.gdal.__version__)
>3.0.2
3
  • Can you please update your question to include how you installed gdal using conda and also which version of gdal you have installed on your conda environment? – Aaron Nov 10 '20 at 21:20
  • There! added both pieces of information. I hope it helps! =) – Felipe D. Nov 10 '20 at 21:46
  • FileGDB support requires two things, 1. the Esri FileGDB API library (stored in a directory in your PATH) and 2. the GDAL FileGDB driver (either compiled into the GDAL library itself or compiled separately as a driver plugin and stored in the GDAL_DRIVER_PATH). You only have 1. (the API library) and I don't think Anaconda or conda-forge provide a filegdb enabled GDAL or a driver plugin so you're out of luck there. You may be able to get it to work if you can find and download a version of the driver as a plugin compiled for the same version of gdal that your conda env provides – user2856 Nov 10 '20 at 22:56

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.