13

I've been using the great Shapely/Fiona combo successfully on Linux, but now i need to create a kind of production environment on windows and theres only one problem. When i try to import fiona, i get the following error:

Import DLL error

if i try to check dependancies of the ogrext.pdy using dependancy walker, it seems it is trying to load GDAL version 1.10 dll and fails. Strangely though, i have GDAL 1.9.2 installed and it seems to import into python without a problem (from osgeo import gdal). So maybe its not even related to the fiona import issue. Also, im 100% i downloaded the fiona installer for python 2.7 since i know issues can arise if you use .pyd files intended for a different version of python.

Note, im using a standalone installation of python 2.7.5, without using osgeo4w installer.

5
  • If it needs GDAL 1.10 and you only have 1.9 that isn't going to work
    – Nathan W
    Jul 30, 2013 at 12:16
  • Hmmm, tried with 1.10 just now, same story
    – U2ros
    Jul 30, 2013 at 12:26
  • @sgillies should be around somewhere. He might be able to help.
    – Nathan W
    Jul 30, 2013 at 12:32
  • Seems that a similar problem arose with osx version of fiona couple of versions back, something to do with GDAL paths, i ll play around some more...
    – U2ros
    Jul 30, 2013 at 12:35
  • 3
    I don't use Windows, but I would try the Fiona installers at lfd.uci.edu/~gohlke/pythonlibs/#fiona together with the GDAL installers: lfd.uci.edu/~gohlke/pythonlibs/#gdal.
    – sgillies
    Jul 30, 2013 at 20:40

7 Answers 7

4

This ongoing issue used to be caused by Fiona being incompatible with GDAL, but Fiona has been updated, so the below answers may be more relevant.

Fiona 1.8.9 supports GDAL 3.0

Documentation:

A shim module and support for GDAL 3.0 has been added. The package can now be built and used with GDAL 3.0 and PROJ 6.1 or 6.2. Note that the 1.8.9 wheels we will upload to PyPI will contain GDAL 2.4.2 and PROJ 4.9.3 as in the 1.8.8 wheels.

2

I had exacltly the same problem after installing GDAL by the method explained in How to run OGR in ArcGIS Scripts? (including setting the environment variables). I am not sure whether it didn't work, but either it was based on the old GDAL version 1.11, or the Python 2.7 bindings that maybe did not work properly.

I fixed it by following the steps above, especially by downloading the latest GDAL version 2.1 from http://www.lfd.uci.edu/~gohlke/pythonlibs/#gdal. By installing the package by pip, the old GDAL version was deleted and replaced by the latest. After restarting the IDE, I could import gdal and fiona without any errors.

2

edit 202202021:

unsure of how relevant this is now, but reaplced old links with working ones.

I had this problem just last night. To fix it, make sure you:

  1. Have the GDAL Libraries (install the core .msi, then the python bindings .msi)
  2. Setup the GDAL environmental variables.

I think that was all I did. If it doesn't work let me know and I'll further investigate.

old1 old2

0
1

I have exactly the same problem. You need to use the GDAL package from http://www.lfd.uci.edu/~gohlke/pythonlibs/#gdal. Sadly it's gdal 1.1. cf.http://sgillies.net/blog/1190/fiona-1-0-1/#comment2806

2
  • 1.10 is never than 1.9
    – U2ros
    Aug 28, 2013 at 13:37
  • 1
    Okay, important comment!: I still had issues with this on some computers... why? Because i don't read text! In the site header, theres a warning about dependancies... and on computers where it didn't work, i was missing visual c++ redistributables!
    – U2ros
    Oct 10, 2014 at 19:04
1

Old question but leaving this here for anyone else who stumbles across it:

Geoff Boeing wrote a great tutorial on how to install the geopandas library, which goes over installation of fiona (as well as other libraries like shapely, gdal, pyproj...). The tutorial is located here: http://geoffboeing.com/2014/09/using-geopandas-windows/

The step that tripped me up was that I had a previoes osgeo installation (I think from installing postGIS) and it was not playing nice with the wheel files from http://www.lfd.uci.edu/~gohlke/pythonlibs/#fiona

Uninstalling all the related libraries and then building exclusively from those wheel files fixed the DLL import error for me (using windows 10)

1

Like others, let me share my experience with solving this problem for those who are still struggling with it on Windows and who have the same python & gdal versions.

In my case I got the ImportError: DLL load failed: The specified module could not be found error after installing geopandas (version 0.6.2) with conda and python 3.7.3, and when trying to import both gdal (version 3.0.2) and fiona (version 1.8.11). I'm on Windows 10 (version 1709).

After trying different proposed solutions without success (essentially following Geoff Boeing's guide to installing geopandas on Windows and installing Christoph Gohlke's GDAL wheels), what seemed to make it work for me was installing the Microsoft Visual C++ Redistributable for Visual Studio 2015, 2017 and 2019 as indicated by Gohlke in the header of his page and as mentioned by @U2ros.

So no need to install Gohlke's wheels; you can just use conda or pip to install fiona and geopandas. And as indicated in the update to this answer, GDAL version 3 is indeed supported by fiona (versions 1.8.9+).

0

I see this question has been answered many times, but i wanna share my experience resolving the problem, for the people who had the same problem with the same python version and come to this question.

I had also some troubles when i installed fiona and tried to import it. I had this kind of message

>>> import fiona
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "D:\Software\Ingenieria\Anaconda2\lib\site-packages\fiona\__init__.py", l
ine 77, in <module>
    from fiona.collection import Collection, BytesCollection, vsi_path
  File "D:\Software\Ingenieria\Anaconda2\lib\site-packages\fiona\collection.py",
 line 9, in <module>
    from fiona.ogrext import Iterator, ItemsIterator, KeysIterator
ImportError: DLL load failed: The specified module could not be found.

How did it work for me at the end?

  • I installed the distributions GDAL 2.2.4 and Fiona from this link
  • Then i checked if my computer has a c++ compiler for python (here link with some information about which one you may need to install). In some forums questions i read that GDAL need this compiler to be able to work.
  • Then i added the Osgeo folder path (there are the dlls for fiona) to my path environment variable, some pics from my pc Print screen 1 Print screen 2

After doing those steps i never had any more problems with fiona. At first, i was using the GDAL version 1.1.4 but it never worked with this one. You can try first with the version one, and if it doesn´t work then install the version 2.2.4

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.