Skip to content
Discussion options

You must be logged in to vote

I think this has to do with older versions of fiona checking if a path is a zipfile before checking if it is a shapefile.

Given the same dependencies below:
shapely 2.0.7
fiona 1.10.1
geopandas 0.13.2

You should be able to open the shapefile with the code below

import fiona

path = elections.get_file_list()[0]

with fiona.open(path) as src:
    gdf = gpd.GeoDataFrame.from_features(src, crs=src.crs)    

This will open the shapefile using fiona instead of geopandas, which bypasses the zipfile check for these versions. You then convert to a projected geodataframe with geopandas. Hopefully this works. no need to change any libraries.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@pijao23
Comment options

Answer selected by pijao23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants