Python module not found error

Summary

A Python block in a Retool Workflow (Cloud-hosted) that had been working reliably suddenly began failing at runtime with 'ModuleNotFoundError: No module named msgspec' under the Python 3.10 runtime.

AI Response

This matches a recurring pattern where a previously-working Workflow block abruptly fails to resolve a module after a runtime/environment change, even though nothing in the block was edited. A common characteristic is that the block still runs when executed in the editor with previous blocks, but fails on a full or scheduled run because those execute in a different environment. Reported workarounds include explicitly re-declaring/adding the dependency in the Workflow's Python library settings (and pinning a known-good version), then re-saving and re-deploying so the runtime rebuilds with the module present. Confirming whether the failure only occurs on the full/scheduled run versus single-block execution will help isolate it.

Sources

:bookmark: Previously scheduled Workflow fails: Error cannot find module numbro
A solved report corroborating the same pattern—a previously-working scheduled Workflow suddenly failing with a module-not-found error that works when run block-by-block but fails on full/scheduled runs—along with a workaround and staff acknowledgment.
:bookmark: Workflows: python package is installed but import fails
A solved, bug-tagged topic specifically about a Python package failing to import inside a Workflow Python block despite being available, closely mirroring this module-resolution failure.

The Community Team is testing out a new automation. Let us know if it's helpful (or not) by leaving a :heart:, :+1:, or :-1:. Or by marking this post as the "Solution"! Let us know if you have any feedback here. :rocket: