How to install python module fiona on Windows OS ?

In this blog, I talk about the requirements and the steps for installing module fiona on Windows OS.

Recently, I learn how to visualise geographical data with python. However, I met difficulties when I installed the module fiona (on my professional PC which is Windows OS). So in this blog, I’ll introduce how to install fiona module on Windows OS with following points:

  • What is fiona ?
  • Python Requirements
  • Download a binary distribution of GDAL
  • Fiona’s binary wheel
  • Frequently Questioned Answers (FQA)

What is “fiona” ?

Fiona is designed to be simple and dependable. It focuses on reading and writing data in standard Python IO style and relies upon familiar Python types and protocols such as files, dictionaries, mappings, and iterators instead of classes specific to OGR. Fiona can read and write real-world data using multi-layered GIS formats and zipped virtual file systems and integrates readily with other Python GIS packages such as pyproj, Rtree, and Shapely.

Python Requirements

  • Python versions 2.7 or 3.4+.
  • GDAL version 1.11-2.4. ❗ GDAL version 3 is not yet supported.
  • Fiona depends on the modules enum34, six, cligj, munch, argparse, and ordereddict. Pip will fetch these requirements for you, but users installing Fiona from a Windows installer must get them separately.

Download a binary distribution of GDAL

URL

You can download it here.

GDAL old releases

Choose “win32” or “x64”?

It depends on your python:

import struct
print(struct.calcsize("P") * 8)

You will get 64 or 32 to indicate which python version do you have installed.

What should we download?

Since python that I have installed is version Python 3.7 (32 bit), I choose “release-1911-gdal-2-4-1-mapserver-7-2-2”.

GDAL download table

We need to download:

  • Compiled binaries in a single .zip package.
  • Compiled libraries and headers.
  • Generic installer for the GDAL core components.
  • Installer for the GDAL python bindings (requires to install the GDAL core).

Update environment variables

  • PATH: C:\Program Files (x86)\GDAL
  • GDAL_DATA: C:\Program Files (x86)\GDAL\gdal-data
  • GDAL_DRIVER_PATH: C:\Program Files (x86)\GDAL\gdalplugins
  • GDAL_VERSION: 2.4.1

    How to check GDAL version ?
    Type following command in cmd: gdalinfo --version

Fiona’s binary wheel

You can download it here.

FQA

  • Q1: ImportError: DLL load failed: %1 is not a valid Win32 application (ImportError: DLL load failed: %1 n est pas une application Win32 valide)
    This might because your python is 32 bit version. Thus, all python modules should be 32 bit as well. Similarly, if your python is 64 bit version, you should install 64 bit python modules.

  • Q2: … is not a supported wheel on this platform
    Item.

  • Q3: ImportError: DLL load failed: The specified module could not be found.
    Maybe you forgot installing one/some of dependencies of module fiona: GDAL, enum34, six, cligj, munch, argparse, and ordereddict. More detail in section “Python Requirements”.

Conclusion

In this blog, I talk about the requirements and the steps for installing module fiona on Windows OS. Hope it’s useful for you!

References