Skip to content

fix pyogrio.errors.DataSourceError #75

@Herald-TUOS

Description

@Herald-TUOS

Update MANIFEST.in to include the ons/nrs_2011.zip and ons/nrs_2021.zip files. The following error is caused because these zip files are not bundled with the library

  File "/home/ph1ho/Documents/pvdeployment/.venv/lib/python3.14/site-packages/geocode/geocode.py", line 137, in get_llsoa_boundaries
    return self.ons_nrs._load_llsoa_boundaries(version)
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^
  File "/home/ph1ho/Documents/pvdeployment/.venv/lib/python3.14/site-packages/geocode/ons_nrs.py", line 245, in _load_llsoa_boundaries
    llsoa_regions_scots = self._load_llsoa_boundaries_scots_regions(version)
  File "/home/ph1ho/Documents/pvdeployment/.venv/lib/python3.14/site-packages/geocode/ons_nrs.py", line 219, in _load_llsoa_boundaries_scots_regions
    gdf = gpd.read_file(f"zip://{zip_path}!{llsoa_filename[version]}")
  File "/home/ph1ho/Documents/pvdeployment/.venv/lib/python3.14/site-packages/geopandas/io/file.py", line 316, in _read_file
    return _read_file_pyogrio(
        filename, bbox=bbox, mask=mask, columns=columns, rows=rows, **kwargs
    )
  File "/home/ph1ho/Documents/pvdeployment/.venv/lib/python3.14/site-packages/geopandas/io/file.py", line 576, in _read_file_pyogrio
    return pyogrio.read_dataframe(path_or_bytes, bbox=bbox, **kwargs)
           ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ph1ho/Documents/pvdeployment/.venv/lib/python3.14/site-packages/pyogrio/geopandas.py", line 382, in read_dataframe
    result = read_func(
        path_or_buffer,
    ...<15 lines>...
        **kwargs,
    )
  File "/home/ph1ho/Documents/pvdeployment/.venv/lib/python3.14/site-packages/pyogrio/raw.py", line 200, in read
    return ogr_read(
        get_vsi_path_or_buffer(path_or_buffer),
    ...<15 lines>...
        datetime_as_string=datetime_as_string,
    )
  File "pyogrio/_io.pyx", line 1412, in pyogrio._io.ogr_read
  File "pyogrio/_io.pyx", line 262, in pyogrio._io.ogr_open
pyogrio.errors.DataSourceError: '/vsizip//home/ph1ho/Documents/pvdeployment/.venv/lib/python3.14/site-packages/geocode/ons/nrs_2011.zip/OutputArea2011_EoR_WGS84.shp' does not exist in the file system, and is not recognized as a supported dataset name.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions