Install & Compatibility
Where this runs
tested against v4.1.1 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
py 3.9
✕ build_error
✓ 3.93s
46MB installed
● package 46MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
task
✓ from robocorp.tasks import task
✗ from robocorp.robot import task
Old Robot Framework-centric paths or incorrect top-level imports are common mistakes.
setup
✓ from robocorp.tasks import setup
Used for defining setup fixtures for tasks or sessions.
teardown
✓ from robocorp.tasks import teardown
Used for defining teardown fixtures for tasks or sessions.
This quickstart defines a basic Robocorp task using the `@task` decorator. It uses `robocorp.log` for output and demonstrates how to access environment variables. Tasks are executed via the `python -m robocorp.tasks run` command, specifying the file or directory and optionally the task name.
import os
from robocorp.tasks import task
from robocorp import log
@task
def hello_robocorp_world():
"""A simple Robocorp task that logs a message."""
name = os.environ.get('ROBOCORP_USER_NAME', 'World')
log.info(f"Hello, {name} from Robocorp!")
log.critical("This is a critical log message.")
log.debug("This is a debug message.")
# To run: Save as tasks.py and execute 'python -m robocorp.tasks run tasks.py'
# You can also use 'python -m robocorp.tasks run . -t hello_robocorp_world' in a directory.
robocorp-tasks --version
Debug
Known issues
breakingThe broader Robocorp ecosystem has transitioned focus from Robot Framework to Python. While existing Robot Framework bots continue to operate, all new development and tooling support is directed towards Python. Users should plan to migrate or develop new automations in Python.fixDevelop new automations in Python. Convert existing Robot Framework projects to Python where feasible.
affects: All versions post-February 2024 (LTS for Enterprise until Feb 2025)
deprecatedThe `Robocorp Code` VS Code extension has been deprecated and replaced by the `Sema4.ai extension`. Users should uninstall the old extension and install the new one for continued support and new features.fixUninstall 'Robocorp Code' extension from VS Code and install 'Sema4.ai Extension'.
affects: Robocorp Code extension versions prior to Sema4.ai extension release
gotchaRobocorp libraries with versions `0.x.x` are considered in development and may introduce breaking changes on any update. Although `robocorp-tasks` is now `4.x.x`, developers should always check the changelog for major version updates (`X.0.0`) for specific migration guidance as per SemVer.fixAlways consult the changelog (e.g., on PyPI or GitHub) when upgrading to a new major version to understand breaking changes and migration steps.
affects: All major version increments (e.g., 3.x.x to 4.x.x)
gotchaModules and functions within the Robocorp libraries that start with an underscore (`_`) are considered internal and are not part of the public API. Importing or relying on these can lead to unexpected behavior or breaking changes in minor updates.fixOnly import and use symbols directly exposed under the `robocorp.<library>` namespace (e.g., `robocorp.tasks.task`), avoiding any `_` prefixed modules or functions.
affects: All versions
gotchaIn current versions, the `python -m robocorp.tasks run` command is designed to execute only one task per invocation. If multiple tasks are found in the target script/directory without a specific task name (`-t`) being provided, an error will be raised.fixWhen running tasks, either ensure only one `@task` decorated function exists in the target file/directory, or explicitly specify the task to run using the `-t <task_name>` argument: `python -m robocorp.tasks run my_tasks.py -t my_specific_task`.
affects: All versions (as of 4.1.1)
Errors
Common errors & fixes
Error: "Sending logoff command to the desktop session"
This error can occur if the Windows Customer Experience Improvement Program interferes with desktop sessions, causing unexpected logoffs during automation.
fixDisable the Windows Group Policy 'User Account Control: Behavior of the elevation prompt for standard users' and 'Windows Customer Experience Improvement Program' settings. Refer to Robocorp documentation for specific policy paths.
UnicodeEncodeError or garbled characters in logs/output
Often related to Windows code page settings not being configured for Unicode, leading to character encoding issues.
fixEnsure your Windows system's code page is set to Unicode. Check Robocorp's troubleshooting guide for detailed steps on adjusting locale settings.
Encountering a PID lock in environment building
This typically indicates an issue during the creation or setup of the Python execution environment by RCC (Robocorp Command Center), possibly due to a stuck process or cache corruption.
fixClear or clean up local environment caches using the `rcc` command-line tool. Consult RCC documentation for specific cache clearing commands.
ImportError: cannot import name '_internal_module' from 'robocorp.tasks'
Attempting to import internal modules or functions that are not part of the public API (indicated by a leading underscore).
fixOnly import symbols that are part of the documented public API. Avoid importing any modules or functions that begin with an underscore (`_`).
Upgrade
Version history
4.1.1latest on PyPI · released Mar 13, 2026
Audit
Dependencies
robocorp-logrequiredLeveraged by robocorp-tasks for out-of-the-box logging functionality.
robocorpoptionalMetapackage including core features like Work Items, Vault, and other Control Room integrations; recommended for full framework utilization.
robocorp-browseroptionalCommonly used for web automation tasks within the Robocorp ecosystem.
robocorp-workitemsoptionalUsed for interacting with Control Room work items in automations.