Upgrade Python in the C3 Agentic AI Platform
Since C3 Agentic AI Platform version 8.6, the platform supports Python versions 3.9 through 3.12. The platform version 8.9 and higher defaults to Python version 3.12.
Defaulting to Python version 3.12 affects the following:
- Changes the Python versions used by the JDK Enhancement Proposal (JEP) executor to Python 3.12
- Includes Python 3.12 by default in the JupyterLab image
Python version 3.9 will continue to run on the platform, however the Python Core Team no longer supports Python version 3.9 as of October 2025. See Status of Python Versions to learn more.
To avoid issues related to outdated Python versions, upgrade your runtimes, actions, and pipelines to use Python version 3.12.
Support for Python version upgrade
To support the runtime, action, and pipeline runtime upgrade process, C3 AI provides the following:
- Mutually compatible set of platform runtimes: For each platform runtime, C3 AI provides a new runtime based on Python version 3.12. For example, for the platform runtime
py-data, usepy-data_312instead. - Upgraded library versions: The new platform runtimes include new versions of widely-used libraries. For example, the Pandas library upgraded from version 1.3 to 2.2.
- Upgraded platform machine learning pipes: The upgraded MlPipe use Python version 3.12 runtimes. For example, the previous pipe
SklearnPipecorresponds to the upgraded pipeSklearnPipe_312. - Migration tool to upgrade pipelines: The tool migrates platform pipes to use the new versions that support Python 3.12. However, you must test these upgraded pipelines in case of incompatibilities with the new library versions.
Steps to upgrade code to new Python version
Complete the following steps to upgrade your code to use Python version 3.12.
Create new versions of custom runtimes
If you have custom runtimes, create new versions of those runtimes that use Python 3.12 and the upgraded library versions. Name the new runtime according to the following convention: py-<runtime-name>_312. Inherit the platform runtimes where appropriate, such as py-data_312.
Change action claims to use new runtimes
Change the action claims for the actions you want to upgrade to use the new runtimes. If you claim py, it runs Python 3.12 by default unless the code is called from a Python function that has a runtime with a different Python version. To configure a Python action without external library dependencies to always run in Python 3.12, use the Python 3.12 runtime, such as py-data.312
Update action claims for Lambda Feature Sets
Update the action claims for any Lambda Feature Sets to use Python 3.12 runtimes. Specifically change code with the claim py-data to use py-data_312. After you update the action claims, test the code to make sure there are no incompatibilities from changes in the Pandas library.
Update custom pipe
Update any custom pipes that claim Python 3.9 runtimes to use Python 3.12 runtimes. After you update the custom pipes, test the pipes to make sure the changes in the underlying third-party libraries do not impact them.
Update pipelines and models to use atomic pipes
Update pipelines and models to use atomic pipes. Update references to platform atomic pipes with the provided migration tool. Test the pipelines and address any incompatibilities from third-party library updates. For trained models, test whether the models work with the new libraries, or if you need to retrain the model or keep the existing Python 3.9 version.
Update Jupyter notebook kernels
Change Jupyter notebook kernels to use a Python 3.12 runtime and test the notebooks to make sure they run correctly.
Test non-ephemeral data stored with the Data.Persisted Type
If you have non-ephemeral data stored in files that use the Data.Persisted Type, test that the data is still readable with the Python 3.12 runtimes. Apache Arrow is the default serialization format and will not affect most data. However, in some cases that do not support Apache Arrow, such as multi-indexes, the data is stored as pickled Pandas DataFrame. In these cases, you must migrate the data.
Steps for code you do not want to upgrade
If you have code you do not want to upgrade to use Python 3.12, complete the following steps.
Maintain claim version
If you have actions with the claim py, they run in Python 3.12 by default. To ensure they always run in Python 3.9, specify a 3.9 claim such as py-data.
Call Pandas APIs
For calls that produce c3.Data for Pandas APIs, such as eval() and evalFeatureSetBatch(), immediately call to_pandas before you call any Pandas APIs. Otherwise, the Python 3.9 client process that runs in Py4j or Jupyter returns a deserialization error.
Because the Pandas APIs on c3.Data are deprecated, C3 AI recommends you upgrade your runtime and change your code to call to_pandas immediately before calling Pandas APIs that produce c3.Data.
Maintain action claim versions for Lambda Feature Sets
To maintain Lambda Feature Set action claim versions, specify an explicit action claim for a Python 3.9 runtime, such as py-data.
Maintain Jupyter notebook kernel version
If you have Jupyter notebooks that use the py-data-plot kernel and you do not want to upgrade them to the py-data-plot_312 kernel, you must install py-data-plot from the kernel management panel in Jupyter. py-data-plot is no longer installed by default.
Python code changes
The following table lists deprecated methods, their versions, and their replacement if available:
| Version | Deprecated | Replacement |
|---|---|---|
| 3.9 | array.tostring()/fromstring() → tobytes()/frombytes() | N/A |
| 3.9 | nntplib.NNTP.xpath(), xgtitle() | .descriptions() |
| 3.9 | sys.callstats(), get/setcheckinterval() | N/A |
| 3.10 | threading.* legacy methods | .is_set(), .name, .daemon properties |
| 3.10 | pathlib.Path.link_to() | .hardlink_to() |
| 3.10 | cgi.log() | Deprecated |
| 3.10 | ssl OP_NO_SSL*, PROTOCOL_SSL* | SSLContext.minimum_version, wrap_socket() |
| 3.11 | classmethod chaining | wrapped |
| 3.11 | Octal escapes >0o377 | Avoid; future SyntaxError |
| 3.11 | int() fallback via trunc | Implement int or index |
| 3.11 | configparser legacy APIs | Use newer ConfigParser interfaces |
| 3.11 | importlib.resources old functions | 3.9+ API |
| 3.11 | locale.getdefaultlocale(), turtle.settiltangle() | Use recommended replacements |
| 3.11 | typing.Text, TypedDict syntax, webbrowser.MacOSX | Use modern alternatives |
| 3.11 | unittest oddities (.findTestCases, .usageExit) | Replace with TestLoader, remove usageExit |
| 3.11 | re.template / T flags | Deprecated |
| 3.12 | C-API wstr, removed smptd/distutils/imp | Use importlib, other modules |
| 3.12 | Old unittest bits | Removed |
| 3.12 | Invalid backslashes warnings | Now SyntaxWarning; will be SyntaxError |
| 3.12 | Pending removals (CGI handler, locale.getdefaultlocale, etc.) | Removal by Python 3.15 |
Pandas code changes
The following table lists deprecated Pandas methods, their versions, and their replacements if available:
| Version | Deprecated | Replacement |
|---|---|---|
| 1.4 | Int64Index, UInt64Index, Float64Index | Index with specified dtype |
| 1.4 | DataFrame.append(), Series.append() | pd.concat([...]) |
| 2.0.0 | fill_method=None deprecated in pct_change | Use explicit method or default behaviors |
| 2.0.0 | pd.date_range closed parameter | Replace closed with inclusive |
| 2.2.0 | Auto downcasting in .replace(), .fillna() | infer_objects(), or set option to opt-in |
| 2.2.0 | SQLAlchemy 1.4 compatibility | Upgrade to SQLAlchemy ≥ 2.0 |
| 2.2.0 | Chained assignment warning (via COW setting) | Use safer assignment or enable copy_on_write option |
Data changes
The following table lists deprecated data methods and their replacements:
| Deprecated / Removed | Replacement or Alternative |
|---|---|
eval().<pandas_operations> | eval().to_pandas().<pandas_operations> |
Data.from_pandas() | Data.Persisted.from_pandas() |
Library changes
The following table lists library version changes in Python 3.12 runtimes:
| Library | Runtime | Old version | New version |
|---|---|---|---|
| dill | py-dill_312 | 0.3.9 | 0.3.9 |
| matplotlib | py-matplotlib_312 | 3.4.3 | 3.10 |
| numpy | py-data_312 | 1.22.4 | 1.26.4 |
| optuma | py-optuna_312 | 2.10 | 4.4 |
| pandas | py-data_312 | 1.3.4 | 2.2.3 |
| pillow | py-matplotlib_312 | 10.2.0 | 10.2.0 |
| polars | py-data_312 | 0.16.11 | 0.19.14 |
| pyarrow | py-arrow_312 | 14.0.1 | 19.0.0 |
| scikit-learn | py-sklearn_312 | 0.24.2 | 1.6.1 |
| scipy | py-scipy_312 | 1.10.0 | 1.11.4 |
| seaborn | py-seaborn_312 | 0.11 | 0.13.2 |
| shap | py-shap_312 | 0.40 | 0.48.0 |
| sktime | py-statsmodels_312 | 0.14.1 | 0.37.1 |
| statsmodels | py-statsmodels_312 | 0.13 | 0.14.4 |
| tensorflow | py-tf_312 | 2.12.1 | 2.18 |
| xgboost | py-xgboost_312 | 1.7.1 | 3.0.2 |