Registry / data / xtgeo
library4.23.0pypypi✓ verified 83d ago

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.

pip install xtgeo
INSTALL
IMPORT
SIG · XTGEO
X
xtgeo
datapythonv4.23.0
Install
23.9s avg
Import
4960ms
Disk
807MB
Pass rate
5/ 10
Env Coverage5 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v4.17.1 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
build_error
glibc
py 3.103.95 runs
installs and imports cleanly · install 23.9s · import 4.960s · 842MB
807MB installed
● package 807MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Grid
import xtgeo
from xtgeo import Grid
Direct import of submodules may fail due to lazy loading; use top-level import and access via xtgeo.Grid
Surface
import xtgeo
from xtgeo.surface import RegularSurface
Internal submodule paths have changed; use xtgeo.RegularSurface or xtgeo.Surface

Read a grid and a surface from files and print basic info.

import xtgeo grid = xtgeo.grid_from_file('mygrid.roff') surf = xtgeo.surface_from_file('mysurf.gri') print(grid.ncol, grid.nrow, grid.nlay) print(surf.values.mean())
Debug
Known issues
breakingPython 3.11+ required; Python <=3.10 no longer supported.
fix
Use Python 3.11 or later.
affects: >=4.21.0
gotchaDo 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.
fix
Use `import xtgeo` then `xtgeo.Grid`.
affects: All
deprecatedThe `tables` dependency was removed in 4.18.0; HDF5 support now uses `h5py`. Code relying on `tables` for reading/writing HDF5 will break.
fix
Update code to use `h5py` for HDF5 operations, or pin xtgeo<4.18.0 if `tables` is required.
affects: >=4.18.0
gotchaFile read/write functions expect file-like objects or strings. Passing Path objects may fail due to internal wrapping.
fix
Convert Path objects to string with `str(path)` when calling xtgeo file functions.
affects: All
Errors
Common errors & fixes
ImportError: cannot import name 'Grid' from 'xtgeo'
Attempting to import submodule directly (`from xtgeo import Grid`) before xtgeo is fully loaded.
fix
Use `import xtgeo` then `xtgeo.Grid`.
xtgeo.io._grid_io.grid_from_file() got an unexpected keyword argument 'format'
The `format` argument was removed in favor of auto-detection from file extension.
fix
Remove the `format` parameter; xtgeo now detects format from the file extension.
ModuleNotFoundError: No module named 'xtgeo.xyz'
Internal module reorganization; `xtgeo.xyz` no longer exists as a separate subpackage.
fix
Use `xtgeo.points` and `xtgeo.polygons` for point/polygon data, or access via top-level `xtgeo.Points`.
Upgrade
Version history
4.23.0latest on PyPI · released Jun 2, 2026
Audit
Dependencies

No dependency data recorded yet.

Agent activity
56 hits · last 30 days
node
50
OpenAI (training)
1
Resources
xtgeo — pip install xtgeo · libregistry