Robots upgrade to Python 3.11

Diligent is upgrading the version of Python used by Robots. Based on the schedule below, the cloud-based Robots Agent will be upgraded from Python 3.8.x to Python 3.11.x. During a transition period, both versions of Python will be supported by Robots.

This upgrade also includes updating the associated libraries, including Pandas from version 1.2.4 to 2.2.0, and Requests from version 2.26.0 to 2.31.0.

If your organization uses HighBond robots or Workflow robots, read this topic to familiarize yourself with the implications of the upgrade.

The Python Software Foundation has announced that Python 3.8 is officially end-of-life on 14 October 2024.

Impact on customers

One or more of your Python/HCL scripts could potentially be impacted by the upgrade to Python 3.11. If script logic that runs in Python 3.8 no longer runs in Python 3.11, you need to update the script logic.

Robots customers cannot opt out of the Python upgrade. For a limited period of time, when editing individual scripts, you can choose to revert a script to run using Python 3.8.

The easiest way to check if your existing scripts run without issue in Python 3.11 is to open them in the Robots script editor and try running them. For more information, and a caution, see Test existing Python/HCL scripts in the Robots script editor.

Important

Give yourself sufficient time to test all your Python/HCL scripts before 14 October 2024 when Python 3.8 will no longer be an option in Robots. To avoid disrupting scheduled robot tasks, make any necessary script updates well in advance of the deadline.

Upgrade schedule

Estimated Date Affected area Details
Mid-December 2023 HighBond robots

Newly created script

  • Runs in Python 3.11, Pandas 1.2.4, and Requests 2.26.0. No other option exists.

Existing script created before the Python upgrade

  • In scheduled tasks, continues to run in Python 3.8, as long as the script is not edited.

  • If opened in the Robots script editor, defaults to running in Python 3.11. For a limited period of time, the script editor provides an option for manually downgrading existing scripts to run in Python 3.8.

April 2024 HighBond robots

Newly created script

  • Runs in the latest Python version with the corresponding libraries (Python 3.11, Pandas 2.2.0, and Requests 2.31.0). No other option exists.

Existing script created before the Python upgrade in December 2023

  • In scheduled tasks, continues to run in Python 3.8, as long as the script is not edited.

  • If opened in the Robots script editor, defaults to running in the latest Python version with the corresponding libraries (Python 3.11, Pandas 2.2.0, and Requests 2.31.0). The script editor provides an option for manually downgrading existing scripts to run in Python 3.8 until the end of June 2024.

Script upgraded to Python 3.11 after December 2023

  • In scheduled tasks, continues to run in Python 3.11 with the old libraries (Pandas 1.2.4, Requests 2.26.0), as long as the script is not edited.

  • If opened in the Robots script editor, defaults to running in the latest Python version with the corresponding libraries (Python 3.11, Pandas 2.2.0, Requests 2.31.0). The script editor provides an option for manually downgrading existing scripts to run in Python 3.11 with the old libraries (Pandas 1.2.4, Requests 2.26.0) until the end of June 2024.

April 2024 Workflow robots

Newly created script

  • Runs in the latest Python version with the corresponding libraries (Python 3.11, Pandas 2.2.0, and Requests 2.31.0). No other option exists.

Existing script created before the Python upgrade

  • In scheduled tasks, continues to run in Python 3.8, as long as the script is not edited.

  • If opened in the Robots script editor, defaults to running in Python 3.11. The script editor provides an option for manually downgrading existing scripts to run in Python 3.8 until the end of June 2024.

End of Q2 2024

HighBond robots

Workflow robots

Existing script created before the Python upgrade

  • If opened in the Robots script editor, can no longer be manually downgraded to run in Python 3.8 or in Python 3.11 with the old libraries (Pandas 1.2.4, Requests 2.26.0).

14 October 2024

HighBond robots

Workflow robots

All scripts (includes unedited scripts in scheduled tasks)

  • Run in Python 3.11 with the new libraries (Pandas 2.2.0, and Requests 2.31.0). No other option exists.

Python 3.8 is officially end-of-life. See Status of Python versions.

Test existing Python/HCL scripts in the Robots script editor

Caution

When you open an existing Python 3.8 script in the Robots script editor, the Python 3.11 runtime environment starts by default. If you save and commit the script, without first manually downgrading it to Python 3.8, the new script version is automatically saved with Python 3.11 specified as the associated runtime environment. The specified versions of installed Python dependencies (packages) may also be updated.

If a script version is saved and committed as 3.11, the script editor does not allow you to subsequently downgrade that particular script version to 3.8.

Be careful to save and commit script versions with the Python runtime environment you intend.

Open an existing script in the script editor

  1. Open the Robots app.

  2. From the dashboard in Robots, select the tab for the appropriate robot type:

    • HighBond Robots

    • Workflow Robots

  3. Click a robot to open it. If the robot is inside a folder, open the folder and click the robot.

  4. In the upper-right corner of the robot, click Development to switch to development mode.

  5. In the Script versions tab, select the version of the script that you want to test.

    Typically, you should select the version of the script that has been activated to production mode. If no version has been activated, select the most recent script version, unless you have a reason to select a different version.

  6. In the Version details panel, click Edit script.

    The Robots script editor begins the start-up process, and loads the Python 3.11 runtime environment.

    If the existing script is associated with the Python 3.8 runtime environment, the Update environment button appears on the script editor toolbar. The following message also appears beneath the toolbar:

    Existing scripts now run on Python 3.11. You can revert to Python 3.8 if necessary, until the end of June 2024. Robots will not include Python 3.8.x after end-of-support on 14 October 2024.

    Note

    If no message appears, and the Update environment button is not present, the script is already associated with the Python 3.11 runtime environment. If the script is currently running successfully, no testing related to runtime environment is required.

Check the runtime environment

As you perform the script testing, you may find it useful to check which runtime environment is currently active in the script editor.

  1. Click into the first cell in the script.

  2. Click the more icon to the left of the cell and select Add a cell above.

  3. In the new cell, paste this code:

    import sys 
    print(sys.version)
  4. Run the cell.

    The result displays the currently active runtime environment. For example:

    3.11.4 (main, Dec 15 2023, 23:07:06) [GCC 11.4.1 20230605 (Red Hat 11.4.1-2)]
    3.8.17 (default, Dec 15 2023, 23:05:28) [GCC 11.4.1 20230605 (Red Hat 11.4.1-2)]
  5. When you have finished testing a script, delete the cell containing the system version code.

Run the script to test it

Run the script to test if it is compatible with the Python 3.11 runtime environment.

Tip

If the script typically takes a long time to complete because it imports and analyzes a large data set, you can temporarily modify the script to use a small sample data set for testing. Using small amounts of data allows you to test your organization's scripts more quickly.

Be careful to modify only the target data set and none of the Python code.

  1. When the start-up process is complete, run the script to test it.

    If the script runs successfully to completion, it is compatible with Python 3.11. No further testing of the script is required. You can save and commit the script to associate it with the Python 3.11 runtime environment. See Save and commit the script.

  2. If the script fails, switch the Python runtime environment to 3.8:

    1. On the script editor toolbar, click Update environment.

    2. In the Python Version field, select 3.8 and click Save.

      The script editor runtime environment switches to Python 3.8.

      The message beneath the script editor toolbar updates:

      Robots will not include Python 3.8.x after end-of-support on 14 October 2024. Test existing scripts for compatibility with Python 3.11, available as an option when you commit script updates. You cannot revert to Python 3.8 after the end of June 2024.
  3. Run the script again.

    If the script runs successfully, it is compatible with Python 3.8, but not 3.11. You need to update the script logic to be compatible with 3.11. Consult Python resources for information about differences between the two Python versions.

    If the script fails, the issue is probably not related to the Python runtime environment. You need to debug the script.

Save and commit the script

When you save and commit the script, associate it with either the Python 3.11 or the Python 3.8 runtime environment, depending on the script status.

Important

Associating a script with the Python 3.8 runtime environment is a temporary measure only. It allows you to continue to run the script as you perform additional testing and updating of script logic. By 14 October 2024, all production scripts must run successfully in Python 3.11.

Script status Action
Runs successfully in Python 3.11
  • Associate the script with the Python 3.11 runtime environment

  • No further action required

Fails in Python 3.11

Runs successfully in Python 3.8

  • Associate the script with the Python 3.8 runtime environment

  • Update the script logic so that it runs successful in Python 3.11

Fails in Python 3.11

Fails in Python 3.8

  • Associate the script with the Python 3.11 runtime environment

  • Debug the script so that it runs successful in Python 3.11

Associate the script with the Python 3.11 runtime environment

  1. Do one of the following to verify that the Python 3.11 runtime environment is currently active in the script editor:

    • Confirm that the message below the script editor toolbar displays the information icon and that the message begins with Existing scripts now run on Python 3.11.

    • Specifically check the runtime environment. See Check the runtime environment.

  2. If required, click Update environment and switch the runtime environment to 3.11.

  3. On the script editor toolbar, click Save and commit.

  4. Enter a meaningful commit message to describe your changes.

    Tip

    You may find it useful to add "Runs in Python 3.11" in the commit message.

  5. Optional. Select Save script output to the task run log file.

    When you run a script using a robot task, this option saves all the script output to a log file. The saved output can be useful to review when you are developing and troubleshooting scripts. For more information, see Saving script output to a log file.

  6. Click Commit to save and commit the script.

    The message Your script has been committed successfully appears.

  7. On the page header, click the robot name.

    You are returned to the Script versions tab in the robot. Every time that you save and commit a script, the saved version is added to this tab.

  8. Optional. Verify that the script is associated with the Python 3.11 runtime environment:

    1. Select the script version that you just saved.

    2. In the Version details panel, click Download.

      The script is downloaded to your computer.

    3. Open the script in a text editor.

      The associated runtime environment appears at the top of the script:

      "runtime":"python3.11"

Associate the script with the Python 3.8 runtime environment

  1. Do one of the following to verify that the Python 3.8 runtime environment is currently active in the script editor:

    • Confirm that the message below the script editor toolbar displays the alert icon and that the message begins with Robots will not include Python 3.8.x after end-of-support on 14 October 2024.

    • Specifically check the runtime environment. See Check the runtime environment.

  2. If required, click Update environment and switch the runtime environment to 3.8.

  3. On the script editor toolbar, click Save and commit.

  4. Enter a meaningful commit message to describe your changes.

    Tip

    You may find it useful to add "Runs in Python 3.8" in the commit message.

  5. Optional. Select Save script output to the task run log file.

    When you run a script using a robot task, this option saves all the script output to a log file. The saved output can be useful to review when you are developing and troubleshooting scripts. For more information, see Saving script output to a log file.

  6. Click Commit to save and commit the script.

    The message Your script has been committed successfully appears.

  7. On the page header, click the robot name.

    You are returned to the Script versions tab in the robot. Every time that you save and commit a script, the saved version is added to this tab.

  8. Optional. Verify that the script is associated with the Python 3.8 runtime environment:

    1. Select the script version that you just saved.

    2. In the Version details panel, click Download.

      The script is downloaded to your computer.

    3. Open the script in a text editor.

      The associated runtime environment appears at the top of the script:

      "runtime":"python3.8"