C3 AI Documentation Home

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, use py-data_312 instead.
  • 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 SklearnPipe corresponds to the upgraded pipe SklearnPipe_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.

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:

VersionDeprecatedReplacement
3.9array.tostring()/fromstring()tobytes()/frombytes()N/A
3.9nntplib.NNTP.xpath(), xgtitle().descriptions()
3.9sys.callstats(), get/setcheckinterval()N/A
3.10threading.* legacy methods.is_set(), .name, .daemon properties
3.10pathlib.Path.link_to().hardlink_to()
3.10cgi.log()Deprecated
3.10ssl OP_NO_SSL*, PROTOCOL_SSL*SSLContext.minimum_version, wrap_socket()
3.11classmethod chainingwrapped
3.11Octal escapes >0o377Avoid; future SyntaxError
3.11int() fallback via truncImplement int or index
3.11configparser legacy APIsUse newer ConfigParser interfaces
3.11importlib.resources old functions3.9+ API
3.11locale.getdefaultlocale(), turtle.settiltangle()Use recommended replacements
3.11typing.Text, TypedDict syntax, webbrowser.MacOSXUse modern alternatives
3.11unittest oddities (.findTestCases, .usageExit)Replace with TestLoader, remove usageExit
3.11re.template / T flagsDeprecated
3.12C-API wstr, removed smptd/distutils/impUse importlib, other modules
3.12Old unittest bitsRemoved
3.12Invalid backslashes warningsNow SyntaxWarning; will be SyntaxError
3.12Pending 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:

VersionDeprecatedReplacement
1.4Int64Index, UInt64Index, Float64IndexIndex with specified dtype
1.4DataFrame.append(), Series.append()pd.concat([...])
2.0.0fill_method=None deprecated in pct_changeUse explicit method or default behaviors
2.0.0pd.date_range closed parameterReplace closed with inclusive
2.2.0Auto downcasting in .replace(), .fillna()infer_objects(), or set option to opt-in
2.2.0SQLAlchemy 1.4 compatibilityUpgrade to SQLAlchemy ≥ 2.0
2.2.0Chained 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 / RemovedReplacement 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:

LibraryRuntimeOld versionNew version
dillpy-dill_3120.3.90.3.9
matplotlibpy-matplotlib_3123.4.33.10
numpypy-data_3121.22.41.26.4
optumapy-optuna_3122.104.4
pandaspy-data_3121.3.42.2.3
pillowpy-matplotlib_31210.2.010.2.0
polarspy-data_3120.16.110.19.14
pyarrowpy-arrow_31214.0.119.0.0
scikit-learnpy-sklearn_3120.24.21.6.1
scipypy-scipy_3121.10.01.11.4
seabornpy-seaborn_3120.110.13.2
shappy-shap_3120.400.48.0
sktimepy-statsmodels_3120.14.10.37.1
statsmodelspy-statsmodels_3120.130.14.4
tensorflowpy-tf_3122.12.12.18
xgboostpy-xgboost_3121.7.13.0.2
Was this page helpful?