# Python 2 deprecation / migration to Python 3
URL: https://docs.datarobot.com/en/docs/release/deprecations-and-migrations/python2.html

> Explains the deprecation of Python 2 support within the DataRobot platform and how to migrate to Python 3.

# Python 2 deprecation / migration to Python 3

> [!WARNING] Warning
> DataRobot has deprecated and removed Python 2, in its entirety, from the platform. For SaaS users, all projects built with Python 2 are disabled but still available in the [project management center](https://docs.datarobot.com/en/docs/classic-ui/modeling/manage-projects.html#manage-projects-control-center), where they can be copied and rebuilt with Python 3. For self-managed users, Python 2 is disabled as of release 9.0, as described [here](https://docs.datarobot.com/en/docs/release/deprecations-and-migrations/python2.html#actions-required-and-important-dates).

Part of the deprecation process includes migrating all user projects to Python 3. Upgrading to Python 3 will improve platform reliability and security. Additionally it enables the DataRobot development team to modernize the codebase and deliver more innovative features faster and with better quality.

Pay careful attention to the guidance below as it will likely require actions from you and other members within your organization. If at any point you have questions, reach out to your DataRobot representative with any questions and they will gladly assist in any way possible to make the migration a smooth experience.

This guide explains the deprecation process and how to migrate to Python 3.

## Users impacted

The Python changes apply to the following users:

- All managed AI Platform (SaaS) users.
- All Self-Managed AI Platform users (except net-new installations starting with Release 7.1 or later. See the FAQ for more details).

## Products impacted

- AutoML
- Time series (AutoTS)
- MLOps

## Actions required and important dates

As milestones approach, specific dates will be communicated, both via email communications and within this documentation. View the information for your installation in the appropriate tab.

**Managed AI Platform (Saas):**
Consider the dates below:

March 2022

Starting March 7th, 2022, new projects created on the managed AI Platform (SaaS) will use Python 3 by default for model building and predictions.
Existing projects and models created using Python 2 (created before March 7, 2022) will continue to work as expected.
Deployments can start using models from Python 3 projects. Deployments are not tied to a specific Python version, only the underlying models are.

April 2022

Existing projects and models using Python 2 will start displaying a deprecation notice in the UI as well in the API response between April 15-22, 2022. To reiterate, these projects and models will continue to work as expected while in the deprecated state, however, this is a good time to start planning and executing the migration steps using the guide below.
It is highly recommended that you compute insights and generate compliance documentation you will require for auditing on these projects prior to project disablement (the milestone below). All data computed within the project will be retained in a read-only state for long term reference.
Identify your active and important projects that will be impacted with deprecation and make a plan to migrate them by July 2022.

> [!NOTE] Note
> If a formal model audit process is required in your organization, starting this process as soon as possible to avoid future disruptions to any impacted production workloads is strongly recommended.

July 2022

Deprecated projects will transition to a “disabled” state and will be placed in read-only mode between July 25-31, 2022.
Duplication of projects and downloading artifacts such as Scoring Code, models, model packages, and insights charts will still remain enabled. More details are available in the
Deprecated and disabled functionality
section.
Existing deployments and predictions will continue to operate (uninterrupted) on Python 2 model deployments within MLOps and Prediction Servers, however, no new deployments can be made with Python 2 models. Migrate your Python 2 model deployments before October 2022 using the guide below.
Existing or new deployments and predictions on Python 3 models will not experience any impact or limitations.

October 2022

Python 2 projects will remain in “disabled” state indefinitely. Duplication of projects and additional capabilities will still be supported, as mentioned in the
Deprecated and disabled functionality
section.
Python 2 projects and models will no longer be supported. All project data will be retained in a read-only state. You must replace all critical Python 2 projects and all MLOps model deployments with eligible Python 3 models before October 25, 2022.

Schedule:

Timeline
Projects
Deployments
Action Required
March 7, 2022
Newly created projects and models in these projects use Python 3 by default.
No impact on existing Python 2 model deployments.
Existing or new deployments may use Python 2 or Python 3 models (Python 3 preferable).
None
April 15-22, 2022
Projects using Python 2 to be
deprecated
. No functional impact.
No impact on existing Python 2 model deployments.
Existing or new deployments may use Python 2 or Python 3 models (Python 3 preferable).
Migrate necessary Python 2 projects and deployments to Python 3.
July 25-31, 2022
Projects using Python 2 to be
disabled
and converted to read-only mode.
No impact on existing Python 2 model deployments.
New deployments will not allow Python 2 models (Python 3 models only).
Migrate necessary Python 2 deployments to Python 3.
October 25, 2022
Projects using Python 2 remain in
disabled
and read-only mode indefinitely.
Python 2 model deployments to be
disabled
.
Complete migration in advance of this date.

**Self-Managed AI Platform:**
Consider the dates below:

Release 8.0 upgrades, starting March 2022

Identify critical projects that will be impacted and make a plan to migrate them.

> [!NOTE] Note
> If a formal model audit process is required, starting this process as soon as possible to avoid future disruptions to any impacted production workloads is strongly recommended.

The Python Version field is now added to User Activity Monitor reports for App Usage and Predictions Usage in the UI, API, and exported CSV data. This feature is available from DataRobot release 8.0.3 onwards.
New projects created in Release 8.x will start using Python 3 by default for model building and predictions.
Existing projects and models created using Python 2 will continue to work as expected.
Existing projects and models using Python 2 will begin displaying a deprecation notice in the UI as well in the API response. To reiterate, these projects and models will continue to work as expected while in the deprecated state, however, it is best to start planning and executing the migration steps using the guide below.

Prior to Release 9.0 upgrades, March 2023

Python 2 projects and models will no longer be supported in release 9.x. All project data will be retained in a read-only state. Before upgrading to release 9.x, ensure that all critical Python 2 projects and models are migrated to Python 3 and that any Python 2-based MLOps model deployments have been replaced with eligible Python 3 models.
Python 2 projects and models created prior to 9.x releases will be disabled once you upgrade to release 9.x. The projects will transition to read-only and new computations will be disabled.
You are encouraged to compute insights and generate any compliance documentation for auditing purposes on these projects prior to the 9.0 upgrade when these projects will be disabled. All data computed within the project will be retained in a read-only state for long term reference.


## Deprecated and disabled functionality

Because of outdated dependencies, Python 2 projects will transition first to deprecated and later to disabled. The following table describes the differences.

| Stage | Impact | Function |
| --- | --- | --- |
| Deprecated | No functional impact. A prominent notification will inform users that Python 2 projects will not be supported in the future and that action should be taken to migrate as necessary. | Models and deployments continue to function as expected. |
| Disabled | Further actions on these projects is prevented. Any pre-computed data can be viewed for reference and comparison while migrating to Python 3 and will be retained long-term for audit purposes. | Project and model data is read-only. Any actions involving compute jobs are disabled (e.g., retraining models, adding new models, computing insights charts, etc.). REST API and associated clients will similarly prevent these actions. The following functionality will still be enabled: duplicating projects, and downloading Scoring Code, models, model packages, and insights. Predictions via the public API will no longer function. You must instead use the Prediction API or Batch Prediction API. |

The following functionality is not affected:

- Custom models
- No-code AI Apps
- AI Catalog
- Data Prep

## Guide for migrating to Python 3

Use the following procedures to migrate projects and deployments. For scenarios not covered, contact your DataRobot representative.

### Migrate projects

Migrate projects and models using the “Duplicate project” action on the Manage Projects page. This will create a new project using Python 3 from the same dataset and the same advanced options (for [eligible project](https://docs.datarobot.com/en/docs/classic-ui/modeling/manage-projects.html#duplicate-a-project) types).

Once copied, you must manually recreate models within the project. You can either:

- Re-run Autopilot to build all models.
- Use Manual mode to build select models from the Repository .

After the Python 2 project is migrated, you can delete the project.

### Migrate deployments

For deployments based on a Python 2 model, you have several options:

| Option | Notes |
| --- | --- |
| Replace the deployed model with a Python 3 model after creating a new project. | This is the most straightforward option. While it will require time to build new models and perform the model replacement, it will not impact deployment API predictions because model replacements are seamless. |
| Set up an automatic retraining policy for your model to let the DataRobot rebuild and replace the model for you automatically, using the schedule and modeling strategies you specify. | Requires an MLOps licenseReview the considerations |
| Replace the model with a Custom inference model using the Java Drop-in environment and the Scoring Code export for the Python 2 model. | Requires an MLOps licenseNot all model blueprints support Scoring CodeBest for deployments that do not have low-latency prediction requirements. |
| Export the model package and use the DataRobot Portable Prediction Server (PPS) to serve predictions within your own environment. | Requires an MLOps licenseRequires altering the API integration from the deployments API to a newly hosted endpoint. |

## Tips

The following tips will help with the migration process.

1. Useproject tagsto keep track of which projects need to be migrated (for example,py2-to-migrate) and which ones have already been migrated (for example,py2-migrated).
2. Compute any insights charts that you may want to refer to in the future prior to June 2022 so that they are precomputed and will later be available as read-only when the project becomes disabled.

## FAQ

---
