Install & Compatibility
Where this runs
No compatibility data collected yet for this library.
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
Platform
✓ from ixmp4 import Platform
✗ from ixmp import Platform
The old ixmp library (v3) used 'from ixmp import Platform'. ixmp4 is a separate package.
Scenario
✓ from ixmp4 import Scenario
✗ None
Scenario is imported from the same top-level module.
Run
✓ from ixmp4 import Run
✗ None
Run is also available at top-level.
Connects to a local DuckDB-backed platform, creates a scenario, lists it.
from ixmp4 import Platform
import os
# Create or connect to a local DuckDB-backed platform
# Specify a path; if not provided, uses in-memory
platform = Platform(
backend="duckdb",
path="example.db",
db_url=None
)
# Create a scenario
scenario = platform.scenarios.create(
name="example_scenario",
model="my_model",
scenario_class="reference"
)
# Filter scenarios
scenarios = platform.scenarios.list(name="example*")
print(scenarios)
# Run something (if applicable)
# run = platform.runs.create(scenario=scenario, name="run1")
# print(run)
print("ixmp4 quickstart complete.")
Debug
Known issues
breakingIn ixmp4, the API is completely redesigned from ixmp v3. The old 'from ixmp import Platform' will fail. Use 'from ixmp4 import Platform'.fixUpdate imports and adapt to new class-based API (Platform, Scenario, Run) instead of deprecated patterns.
affects: All versions
gotchaIf you specify both 'path' and 'db_url', the behavior is undefined. Use one or the other. For non-DuckDB backends, use db_url.fixProvide only 'path' for DuckDB (local file), or only 'db_url' for other databases (e.g., PostgreSQL).
affects: All versions <=0.16.3
deprecatedThe 'scenario_class' parameter may be renamed to 'class' in future versions. Watch for deprecation warnings.fixUse 'scenario_class' for now, but check release notes for changes.
affects: 0.16.x
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'ixmp4'
Package not installed or installed in wrong environment.
fixRun 'pip install ixmp4' in the active virtual environment.
ImportError: cannot import name 'Platform' from 'ixmp'
Using old import pattern from ixmp v3 instead of ixmp4.
fixChange to 'from ixmp4 import Platform'. Ensure ixmp4 is installed.
ixmp4.errors.IXMPError: Backend 'postgresql' not supported. Supported backends: duckdb, clickhouse, sqlite
Only specified backends are supported. 'postgresql' is not in the list.
fixUse db_url for PostgreSQL? Currently not supported natively; use DuckDB or ClickHouse instead.
Upgrade
Version history
0.16.3latest on PyPI · released Jun 3, 2026
Audit
Dependencies
pandasoptionalOptional dependency for DataFrame operations; included in [all] extra.
sqlalchemyrequiredDatabase backend; required but automatically installed.
clickhouse-driveroptionalOptional for ClickHouse backend; included in [all] extra.
duckdboptionalOptional for DuckDB backend; included in [all] extra.