Python Scope Fails After Upgrading UiPath.Python.Activities to v2.1.0 with Python 3.11 Installed

Why did Python Scope stopped working after upgrading UiPath.Python.Activities to 2.1.0 and dropdown only shows up to Python_310?

Issue Description

After upgrading UiPath.Python.Activities to version 2.1.0, processes that use the Python Scope activity fail with the following error in the Output panel:

Python Scope: Exception has been thrown by the target of an invocation.

The process does not enter the Python Scope at all. The issue occurs when Python 3.11 is installed on the Robot machine. The error is consistent and reproducible.

Additionally, users upgrading from v1.7.1 will notice that the Python >= 3.10 flexible version selector that was previously available in the Version dropdown has been removed in v2.1.0. Only fixed version options up to Python_310 are available.

Cause

UiPath.Python.Activities v2.1.0 does not support Python 3.11. The version dropdown in v2.1.0 was changed to offer only fixed version selections (Python_27, Python_36, Python_37, Python_38, Python_39, Python_310), removing the flexible >= 3.10 option available in v1.7.1. When Python 3.11 is the only Python installation on the machine, there is no valid version selector available in v2.1.0 to match it.

A secondary contributing factor may be present when the project also has cross-generation package mismatches -- for example, running UiPath.Python.Activities 2.1.0 alongside UiPath.System.Activities 22.10.x and UiPath.UIAutomation.Activities 22.10.x. These packages are from significantly different release generations and may carry incompatible shared library dependencies.

Resolution

Upgrade UiPath.Python.Activities to v2.2.0-preview, which restores the Python >= 3.10 flexible version selector. This correctly maps to a Python 3.11 installation.

Note: As of the time of this article, v2.2.0 remains in prerelease. If a stable release is now available, use the latest stable version.

Steps to Resolve

  1. Open the affected project in UiPath Studio.
  2. Go to Home > Manage Packages.
  3. In the package filter area, enable Include Prerelease.
  4. Search for UiPath.Python.Activities.
  5. Select version 2.2.0-preview (or latest stable if available) and click Update.
  6. In the Python Scope activity, set the Version field to Python >= 3.10.
  7. Confirm the Path field points to the Python 3.11 installation directory (e.g., C:\Users\<username>\AppData\Local\Programs\Python\Python311).
  8. Confirm the Library path field points to python311.dll in the same directory.
  9. Additionally, upgrade any other core activity packages (UiPath.System.Activities, UiPath.UIAutomation.Activities) from legacy versions (22.10.x) to 24.10.x or 25.10.x to align all packages to the same release generation.
  10. Save the project and rerun the process.

Alternative (No Prerelease)

If use of a prerelease package is not permitted:

Install Python 3.10 alongside Python 3.11 (both can coexist on the same machine). Download from: https://www.python.org/downloads/release/python-3100/

Then configure the Python Scope as follows:

  • Version: Python_310
  • Path: C:\Users\<username>\AppData\Local\Programs\Python\Python310
  • Library path: C:\Users\<username>\AppData\Local\Programs\Python\Python310\python310.dll

Additional Notes

  • This behavior was introduced when upgrading from UiPath.Python.Activities 1.7.1 to 2.1.0.
  • The root cause is a product gap -- the >= 3.10 flexible selector was removed in 2.1.0 and restored in 2.2.0-preview.
  • If the issue persists after upgrading the package, collect the UiPath Diagnostic Tool export and run dotnet --info on the Robot machine to rule out .NET runtime issues.