Python integration

Agent Management comes with native Python integration, and the ability to create multiple isolated Python environments, through code envs. See Code environments for more details.

The Agent Management installation phase creates an initial “builtin” Python environment, which is used to run all Python-based internal Agent Management operations, and is also used as a default environment to run user-provided Python code. This builtin Python environment comes with a default set of packages, suitable for this version of Agent Management. These are setup by the Agent Management installer and updated accordingly on Agent Management upgrades. This builtin environment is not controllable nor configurable by users.

Agent Management supports Python 3.11, 3.12, and 3.13 for its builtin Python environment. Depending on the OS used, a suitable Python version is automatically selected for the Python environment. If required, this version can be controlled with the optional -P PYTHONBIN option to the Agent Management installer.

Rebuilding the builtin Python environment

Warning

This procedure should only be performed under instructions from Dataiku Support

It is possible to rebuild the builtin Python virtual environment, if necessary. This is the case if you moved or renamed Agent Management’s data directory, as Python virtual environments embed their full directory name. This may be also be the case if you want to reset the virtualenv to a pristine state following accidental installation / deinstallation of additional packages.

# Stop Agent Management
DATA_DIR/bin/dss stop

# Remove the builtin virtual environment, keeping backup
mv DATA_DIR/pyenv DATA_DIR/pyenv.backup

# Reinstall Agent Management (upgrade mode), using the default Python version for this platform
# This recreates the builtin env in DATA_DIR/pyenv
dataiku-dss-VERSION/installer.sh -d DATA_DIR -u

# Reinstall Agent Management (upgrade mode), choosing the underlying base Python to use
dataiku-dss-VERSION/installer.sh -d DATA_DIR -u -P /usr/local/bin/python3.12

# Restart Agent Management
DATA_DIR/bin/dss start

# When everything is considered stable, remove the backup
rm -rf DATA_DIR/pyenv.backup