The 'schema' argument is not supported with the 'pyogrio' engine

I just updated to Python 3.12.3 …

fig.plot is now tripping up when working with Pandas geodataframes (gdf). It’s very odd … right before the fig.plot(gdf), the dataframe looks normal:
image

and right after (i.e., after the schema argument fail), the gfd looks different:
image

It’s as though fig.plot is changing the input geodataframe structure.

PyGMT information:
version: v0.12.0
System information:
python: 3.12.3 | packaged by conda-forge | (main, Apr 15 2024, 18:20:11) [MSC v.1938 64 bit (AMD64)]
machine: Windows-11-10.0.22631-SP0
Dependency information:
numpy: 1.26.4
pandas: 2.2.2
xarray: 2024.6.0
netCDF4: 1.6.5
packaging: 24.1
contextily: 1.6.0
geopandas: 1.0.1
ipython: None
rioxarray: 0.15.7
ghostscript: 10.03.1
GMT library information:
binary version: 6.5.0
cores: 12
grid layout: rows
image layout:
padding: 2
version: 6.5.0

1 Like

Ah yes, we’re facing some issues with geopandas=1.0.0 and the new default ‘pyogrio’ engine, @seisman has a bug report at geopandas 1.0.0 or pyogrio 0.9.0 doesn't support OGR_GMT output? · Issue #3301 · GenericMappingTools/pygmt · GitHub.

Could you also provide us with the GDAL version (from conda list) you have installed? Is it GDAL 3.8 or 3.9?

1 Like

Thanks @weiji14 – here’s the info:
gdal 3.9.0 py312h7090a6d_5 conda-forge

Oh wait, I got confused with the actual issue. We’ve actually fixed this ValueError: The 'schema' argument is not supported with the 'pyogrio' engine problem already in geopandas: Use io.StringIO to read geojson data and handle compatibility with geopandas v0.x and v1.x by seisman · Pull Request #3247 · GenericMappingTools/pygmt · GitHub, but that will come in the next PyGMT release (v0.13.0), probably not until next month at the earliest.

If you can’t wait and don’t mind installing a beta version with the bugfix applied, you can try to upgrade PyGMT in your conda environment:

python -m pip install --pre --extra-index-url https://test.pypi.org/simple/ pygmt

Let us know if that works.

Unfortunatly it didn’t work for me :frowning_face:. I haven’t been able to run the roads example: Roads — PyGMT

Got:

ValueError: The 'schema' argument is not supported with the 'pyogrio' engine.

Hmm, @emetdan, to help us debug, can you provide the output of running:

import pygmt

pygmt.show_versions()

Hello, I’ve just run into the same issue as well. The exception above ("the ‘schema’ argument is not supported with the ‘pyogiro’ engine) occurs when I try to plot a geopandas GeoDataFrame with polygon features.

PyGMT information:
version: v0.11.0
System information:
python: 3.12.2 | packaged by conda-forge | (main, Feb 16 2024, 20:42:31) [MSC v.1937 64 bit (AMD64)]
executable:
machine: Windows-10
Dependency information:
numpy: 1.26.4
pandas: 2.2.2
xarray: 2023.6.0
netCDF4: 1.6.5
packaging: 23.2
contextily: 1.6.0
geopandas: 1.0.0
ipython: None
rioxarray: 0.15.7
ghostscript: 10.03.0
GMT library information:
binary version: 6.4.0
cores: 16
grid layout: rows
image layout:
library path:
padding: 2
plugin dir:
share dir:
version: 6.4.0

Thanks for providing the version info @momara, did you try if installing the beta version of PyGMT (mentioned above at The 'schema' argument is not supported with the 'pyogrio' engine - #4 by weiji14), to see if it resolves the pyogrio error? I.e.

conda activate <name-of-your-conda-env>
python -m pip install --pre --extra-index-url https://test.pypi.org/simple/ pygmt
python -c "import pygmt; pygmt.show_versions()"

If the installation is successful, you should see a PyGMT version like v0.12.1.dev90+g3a62fc1b1.d20240609 (the devXX part may vary a bit).