8

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.

  • If it needs GDAL 1.10 and you only have 1.9 that isn't going to work – Nathan W Jul 30 '13 at 12:16
  • Hmmm, tried with 1.10 just now, same story – U2ros Jul 30 '13 at 12:26
  • @sgillies should be around somewhere. He might be able to help. – Nathan W Jul 30 '13 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 '13 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 '13 at 20:40
4

I had this error when using fiona version 1.8.6 in comparison with GDAL version 3.0.0.

But version 1.8.6 of fiona doesn't support version 3.0.0 of GDAL as is mentioned in the installation notes:

Fiona requires Python versions 2.7 or 3.4+ and GDAL version 1.11-2.4. GDAL version 3 is not yet supported.

Downgrading GDAL to version 2.4.1 resolved the issue.

2

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.

  • 2
    Both hyperlinks are outdated --404 not found-- – jberrio Aug 22 '18 at 0:45
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.

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

  • 1.10 is never than 1.9 – U2ros Aug 28 '13 at 13:37
  • 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 '14 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)

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, privacy policy and cookie policy

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