S J
S J

Reputation: 163

AttributeError: 'NoneType' object has no attribute 'drvsupport' when using Fiona driver

when I run the following code:

import geopandas as gpd
from shapely.geometry import Point, Polygon
import pandas as pd

gpd.io.file.fiona.drvsupport.supported_drivers['KML'] = 'rw'
my_map = gpd.read_file('mymap.kml', driver='KML')
my_map

I get this error:

    gpd.io.file.fiona.drvsupport.supported_drivers['KML'] = 'rw'
AttributeError: 'NoneType' object has no attribute 'drvsupport'

Can anyone please help to solve this issue?

Upvotes: 9

Views: 6621

Answers (2)

Theo Anagram
Theo Anagram

Reputation: 71

Using the latest version of python, geopandas and fiona this worked for me:

import fiona
fiona.drvsupport.supported_drivers['KML'] = 'rw'

Upvotes: 7

Tim Harding
Tim Harding

Reputation: 156

Recent versions of geopandas import fiona dynamically, and gpd.io.file.fiona is initially None.

My fix was to change to:

from fiona.drvsupport import supported_drivers
supported_drivers['LIBKML'] = 'rw'

Upvotes: 14

Related Questions