Teradata ModelOps Python SDK

raw JSON →
7.2.7 verified Fri May 01 auth: no python

Python client for Teradata ModelOps (TMO), enabling management of machine learning models and experiments on the Teradata Vantage platform. Current version 7.2.7, requires Python >=3.10. Release cadence is roughly monthly.

pip install teradatamodelops
error ModuleNotFoundError: No module named 'teradatamodelops'
cause Package not installed or installed in wrong environment.
fix
Run 'pip install teradatamodelops' in the correct Python environment (requires Python >=3.10).
error AttributeError: module 'teradatamodelops' has no attribute 'TMOModel'
cause Using old import pattern or outdated version (<7.0.0).
fix
Upgrade to latest version with 'pip install --upgrade teradatamodelops' and use 'from teradatamodelops import TMOModel'.
error teradataml.exceptions.TeradataMlException: [Teradata ML] Connection context not found
cause Missing call to create_context() before using TMO.
fix
Call 'create_context(host='...', username='...', password='...')' before using teradatamodelops.
breaking In version 7.x, the import path changed from 'teradatamodelops' (no subpackage) to the same but some classes were renamed. For example, 'Model' is now 'TMOModel'.
fix Use 'from teradatamodelops import TMOModel' instead of 'from teradatamodelops import Model'.
deprecated The method 'TMOModel.deploy()' is deprecated in 7.2.0+. Use 'TMOModel.deploy_model()' instead.
fix Replace model.deploy(...) with model.deploy_model(...).
gotcha The library requires an active Teradata Vantage connection via teradataml. Calling any TMO method without a valid context will raise a connection error.
fix Ensure you call teradataml.create_context() before using any teradatamodelops class.

Basic workflow: connect to Teradata, load data, create a ModelOps model, train, and save.

from teradatamodelops import TMOModel
from teradataml import DataFrame, create_context
# Connect (adjust parameters for your environment)
create_context(host='your_host', username='your_user', password='your_pass')
# Load data
df = DataFrame('your_table')
# Create and train model (example classification)
model = TMOModel(model_type='classification',
                 target_column='target',
                 feature_columns=['feat1','feat2'])
model.fit(df)
# Save model to ModelOps
model_id = model.save(model_name='my_model', project_name='my_project')
print(f'Model saved with ID: {model_id}')