Fiona: Driver not found (GPKG)

Expected behavior and actual behavior.

GPKG driver is avaliable

Steps to reproduce the problem.

import fiona
from fiona._drivers import GDALEnv
env = GDALEnv()

"GPKG" in env.start().drivers().keys()
True

Operating system

Linux, Ubuntu 17.10

Fiona version and provenance

>>> fiona.__version__
'1.7.10.post1'
>>> 

from pip

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 26 (25 by maintainers)

Most upvoted comments

@kannes @sid-kap Fiona requires the GDAL C library but does not depend on the GDAL Python bindings at all – except if you get Fiona from https://www.lfd.uci.edu/~gohlke/pythonlibs/#fiona, but this is Gohlke’s choice for his particular distribution, and not a choice of the Fiona project.

Hi @jachym . I’m building GDAL for the manylinux1 wheels using this Docker image: https://github.com/sgillies/frs-wheel-builds/blob/master/Dockerfile.wheels#L105-L144. I haven’t tested it against a geopackage file yet and will do so. It’s quite possible that GPKG support fails in the configure step due to sqlite3 version issues, and as you know compilation of GDAL would continue without GPKG. I’ll dig into this soon.

The work-around for now is to skip these manylinux1 wheels and build Fiona from a source distribution like this:

GDAL_CONFIG=/path/to/gdal-config pip install --ignore-installed --no-binary fiona fiona>=1.7.10

@sid-kap Fiona 1.7.11.post2 is on PyPI now and includes support for GPKG.

The GDAL library is indeed included in the wheel.

$ tar tzvf ~/Downloads/Fiona-1.7.11.post1-cp36-cp36m-manylinux1_x86_64.whl | grep libs
-rwxrwxrwx  0 0      0     3923064 Feb  9 20:30 fiona/.libs/libhdf5-f60e12ad.so.101.0.0
-rwxrwxrwx  0 0      0      174248 Feb  9 20:30 fiona/.libs/libhdf5_hl-f4337ea0.so.100.0.1
-rwxrwxrwx  0 0      0      505552 Feb  9 20:30 fiona/.libs/libproj-1a5e54ac.so.12.0.0
-rwxrwxrwx  0 0      0      296720 Feb  9 20:30 fiona/.libs/libgeos_c-bd8d3f16.so.1.10.2
-rwxrwxrwx  0 0      0     1717104 Feb  9 20:30 fiona/.libs/libnetcdf-659163d0.so.11.0.4
-rwxrwxrwx  0 0      0       43712 Feb  9 20:30 fiona/.libs/libjson-c-ca0558d5.so.2.0.1
-rwxrwxrwx  0 0      0      399568 Feb  9 20:30 fiona/.libs/libopenjp2-00a09f32.so.2.3.0
-rwxrwxrwx  0 0      0    28095144 Feb  9 20:30 fiona/.libs/libgdal-b402c5c6.so.20.3.1
-rwxrwxrwx  0 0      0      584256 Feb  9 20:30 fiona/.libs/libexpat-0962c39c.so.1.6.7
-rwxrwxrwx  0 0      0     2556976 Feb  9 20:30 fiona/.libs/libgeos-3-6a255356.6.2.so
-rwxrwxrwx  0 0      0     3750144 Feb  9 20:30 fiona/.libs/libcurl-744c4e24.so.4.4.0
-rwxrwxrwx  0 0      0       87528 Feb  9 20:30 fiona/.libs/libz-a147dcb0.so.1.2.3

When you install the wheel via pip install fiona these files will be unpacked under lib/python3.6/site-packages/fiona. If you’ve installed Fiona before in some other way, I suggest deleting your virtual environment and starting over.

@jachym the 1.8a1 wheels I have uploaded to PyPI this morning should have GPKG support thanks to help from Even Rouault. Can you try pip install fiona==1.8a1 and let me know if it works for you?