The first time you run Rasa Pro 3.21 on Python 3.14, two warnings appear before the output: SyntaxWarning: 'return' in a 'finally' block. They’re harmless. They come from Sanic, a web library that Rasa Pro installs, and they appear only once. Here’s what happened, and why you can ignore them.
What I Was Doing
I was installing Rasa Pro 3.21.4 on a Mac with Python 3.14.10, following Installing Rasa Pro: Setting Up Your Development Environment. Its last step runs rasa --version for the first time.
What I Expected
Rasa’s version details, and nothing else.
What I Got
Two warnings came first, then the version details:
/Users/user/my-rasa-agent/.venv/lib/python3.14/site-packages/sanic/server/websockets/impl.py:437: SyntaxWarning: 'return' in a 'finally' block
return
/Users/user/my-rasa-agent/.venv/lib/python3.14/site-packages/sanic/server/websockets/impl.py:463: SyntaxWarning: 'return' in a 'finally' block
return
Rasa Pro Version : 3.21.4

This first run also took about 40 seconds. Rasa still printed its version details, so the command worked.
What I Checked
- Where it comes from: each warning points to
sanic/server/websockets/impl.py, inside the virtual environment. Sanic is a web framework that Rasa Pro installs. The version here, 25.12.1, is the newest on PyPI (opens in a new tab), and the one Rasa Pro 3.21 requires. - What Python says: What’s New in Python 3.14 (opens in a new tab) explains that since Python 3.14, the compiler warns when a
return,breakorcontinueleaves afinallyblock (PEP 765). It’s a warning, not an error. - When it shows: the compiler warns while it compiles a file. Python saves each compiled file and reuses it on later runs (Python’s tutorial (opens in a new tab)).
Why It Happens
Two lines in Sanic’s code use return inside a finally block, a pattern Python 3.14 now warns about. Python compiles each library file the first time it’s used and saves the result, so the warning appears on the first run only. It’s about how Sanic’s code is written, not about your project, and it doesn’t stop Rasa Pro.
The Fix
There’s nothing to change. Run the same command again:
rasa --version
Python now uses the compiled files it saved, so the warnings don’t come back. They appear again only in a new virtual environment, on its first run.
After the Fix
The second run printed only the version details, in about 5 seconds:
Rasa Pro Version : 3.21.4
Minimum Compatible Version: 3.20.0
Rasa SDK Version : 3.21.2
Python Version : 3.14.10
Operating System : macOS-26.7.3-arm64-arm-64bit-Mach-O

Common Mistakes
| Mistake | Do this instead |
|---|---|
| Taking the warnings for a failed install | Look below them: the version details mean Rasa Pro works. |
| Switching to an older Python to avoid them | Not needed. Rasa Pro 3.21 supports Python 3.14. |
Editing Sanic’s files inside .venv | Leave them as they are. Reinstalling replaces them anyway. |
FAQ
Is the SyntaxWarning dangerous?
No. It’s about how two lines in Sanic are written. Rasa Pro runs normally.
Why does it appear only once?
Python saves each compiled file in a __pycache__ folder and reuses it, so it doesn’t compile the file, or warn, again.
Does it appear on Python 3.13?
No. This warning is new in Python 3.14.
Can I hide it completely?
Python’s docs show a warning filter for that, ignore::SyntaxWarning. Since the warning shows only once, you don’t need it.
Conclusion
The SyntaxWarning: 'return' in a 'finally' block lines come from Sanic and Python 3.14’s new check, not from Rasa or your project. Run the command again, and they’re gone.
Additional Resources
- What’s New in Python 3.14: control flow in finally blocks (opens in a new tab) (Python docs)
- PEP 765 (opens in a new tab) (Python)
- “Compiled” Python files (opens in a new tab) (Python tutorial)
- sanic (opens in a new tab) on PyPI
Related
- Installing Rasa Pro: Setting Up Your Development Environment
- Rasa Tutorial for Beginners: Mastering Rasa Pro in Python, with every part of the series
Rasa and other names mentioned are trademarks of their respective owners. JD Bots isn’t affiliated with or endorsed by Rasa Technologies.
0 comments