Starting with v6.14.0, the Agent v6 integrates both Python 2 and Python 3 runtimes. This means that Agent Checks can be run either with Python 2 or Python 3, depending on the Agent configuration.
By default, the Agent v6 uses the Python 2 runtime. To switch to the Python 3 runtime:
python_version configuration option in your
datadog.yaml configuration file:
DD_PYTHON_VERSION environment variable can be set to
3 to choose which Python runtime is used. If it is set, the
python_version option in
datadog.yaml is ignored.
This is an Agent-wide configuration option: all Python checks launched by an Agent use the same Python runtime.
Since the only change between Agent v6.x and Agent v7.x is that the Agent v7.x includes the Python 3 runtime, contrary to Agent v6.x which includes only the Python 2 runtime, you can switch Python runtimes by switching Agent versions. To switch from one Python runtime to another, choose the appropriate Agent image:
Python 2 runtime: Agent v6 images have the following format:
gcr.io/datadoghq/agent:6.<AGENT_MINOR_VERSION>-jmx for images supporting JMX checks.
Python 3 runtime: Agent v7 images have the following format:
gcr.io/datadoghq/agent:7.<AGENT_MINOR_VERSION>-jmx for images supporting JMX checks.
Additional helpful documentation, links, and articles: