{"id":24853,"library":"xtgeo","title":"XTGeo","description":"XTGeo is a Python library for 3D grids, surfaces, wells, and other geological objects, developed by Equinor. The current version is 4.21.0, requiring Python >=3.11. It is actively maintained with frequent releases (monthly) and provides IO and manipulation for reservoir modelling workflows.","status":"active","version":"4.21.0","language":"python","source_language":"en","source_url":"https://github.com/equinor/xtgeo","tags":["reservoir modelling","grid","surface","well","equinor"],"install":[{"cmd":"pip install xtgeo","lang":"bash","label":"Install via pip"}],"dependencies":[],"imports":[{"note":"Direct import of submodules may fail due to lazy loading; use top-level import and access via xtgeo.Grid","wrong":"from xtgeo import Grid","symbol":"Grid","correct":"import xtgeo"},{"note":"Internal submodule paths have changed; use xtgeo.RegularSurface or xtgeo.Surface","wrong":"from xtgeo.surface import RegularSurface","symbol":"Surface","correct":"import xtgeo"}],"quickstart":{"code":"import xtgeo\n\ngrid = xtgeo.grid_from_file('mygrid.roff')\nsurf = xtgeo.surface_from_file('mysurf.gri')\nprint(grid.ncol, grid.nrow, grid.nlay)\nprint(surf.values.mean())","lang":"python","description":"Read a grid and a surface from files and print basic info."},"warnings":[{"fix":"Use Python 3.11 or later.","message":"Python 3.11+ required; Python <=3.10 no longer supported.","severity":"breaking","affected_versions":">=4.21.0"},{"fix":"Use `import xtgeo` then `xtgeo.Grid`.","message":"Do not import submodules directly (e.g., `from xtgeo.grid import Grid`). The top-level `import xtgeo` lazy-loads subpackages; direct imports may break if internal structure changes.","severity":"gotcha","affected_versions":"All"},{"fix":"Update code to use `h5py` for HDF5 operations, or pin xtgeo<4.18.0 if `tables` is required.","message":"The `tables` dependency was removed in 4.18.0; HDF5 support now uses `h5py`. Code relying on `tables` for reading/writing HDF5 will break.","severity":"deprecated","affected_versions":">=4.18.0"},{"fix":"Convert Path objects to string with `str(path)` when calling xtgeo file functions.","message":"File read/write functions expect file-like objects or strings. Passing Path objects may fail due to internal wrapping.","severity":"gotcha","affected_versions":"All"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Use `import xtgeo` then `xtgeo.Grid`.","cause":"Attempting to import submodule directly (`from xtgeo import Grid`) before xtgeo is fully loaded.","error":"ImportError: cannot import name 'Grid' from 'xtgeo'"},{"fix":"Remove the `format` parameter; xtgeo now detects format from the file extension.","cause":"The `format` argument was removed in favor of auto-detection from file extension.","error":"xtgeo.io._grid_io.grid_from_file() got an unexpected keyword argument 'format'"},{"fix":"Use `xtgeo.points` and `xtgeo.polygons` for point/polygon data, or access via top-level `xtgeo.Points`.","cause":"Internal module reorganization; `xtgeo.xyz` no longer exists as a separate subpackage.","error":"ModuleNotFoundError: No module named 'xtgeo.xyz'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}