Robyn
raw JSON → 0.84.0 verified Mon Apr 27 auth: no python
A super fast async Python web framework with a Rust runtime. Version 0.84.0, released recently; active development with monthly releases.
pip install robyn Common errors
error RuntimeError: Robyn must be started with app.start() or app.run() ↓
cause Calling app methods like app.add_route() after app.start() has been called, or not calling start/run at all.
fix
Ensure you call
app.start(port=...) once at the end of your script, and do not add routes after that. error ImportError: cannot import name 'Robyn' from 'robyn' ↓
cause Outdated Robyn version or wrong import path (e.g., using `from robyn import robyn`).
fix
Upgrade robyn:
pip install --upgrade robyn. Use from robyn import Robyn. error AttributeError: 'NoneType' object has no attribute 'send' ↓
cause Async handler not returning a response, or returning None.
fix
Ensure every async route handler returns a string, dict, or Response object.
Warnings
breaking Robyn requires a Rust toolchain to compile if installing from source; the pip wheel should be pre-compiled for common platforms. ↓
fix Use a pre-built wheel from PyPI; if building from source, install Rust via rustup.
gotcha The app instance must be passed `__file__` (or a string path) as the first argument. Omitting it causes an error. ↓
fix Always use `app = Robyn(__file__)` or `Robyn('MyApp')`.
deprecated The `@app.route()` decorator without an explicit HTTP method is deprecated; use `@app.get()`, `@app.post()`, etc. ↓
fix Replace `@app.route('/path')` with `@app.get('/path')`.
Imports
- Robyn wrong
import robyncorrectfrom robyn import Robyn - Request wrong
from robyn.request import Requestcorrectfrom robyn import Request - jsonify wrong
from robyn.response import jsonifycorrectfrom robyn import jsonify
Quickstart
from robyn import Robyn
app = Robyn(__file__)
@app.get("/")
async def hello(request):
return "Hello, world!"
app.start(port=8080)