Registry / web-framework / reflex

reflex

JSON →
library0.9.5.post2pypypi✓ verified 87d ago

Reflex is a full-stack web framework that allows developers to build web applications entirely in Python. It automatically generates a React-based frontend and manages backend logic, routing, and state. Currently at version 0.8.28.post1, Reflex maintains a rapid release cadence, frequently pushing new features and bug fixes.

pip install reflex
INSTALL
IMPORT
SIG · REFLEX
R
reflex
web-frameworkpythonv0.9.5.post2
Install
9.9s avg
Import
264ms
Disk
96MB
Pass rate
9/ 10
Env Coverage9 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.9.5.post2 · 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
musl
glibc
py 3.10
✓ —
✓ 9.48s
py 3.11
✓ —
✓ 8.25s
py 3.12
✓ —
✓ 7.1s
py 3.13
✓ —
✓ 7.43s
py 3.9
✕ build_error
✓ 17.38s
96MB installed
● package 96MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

reflex
import reflex as rx
The standard and recommended import alias for Reflex.
State
class State(rx.State):
from reflex import State
While technically possible, directly importing 'State' is discouraged; it should be accessed as 'rx.State' after `import reflex as rx` for consistency and clarity within the framework's conventions.

This example creates a simple counter application. Save the code to a file (e.g., `your_app_name.py`). In your terminal, navigate to the directory containing the file. Run `reflex init` to initialize the project, then `reflex run` to start the development server. Access the app in your browser at `http://localhost:3000`.

import reflex as rx class State(rx.State): count: int = 0 def increment(self): self.count += 1 def decrement(self): self.count -= 1 def index(): return rx.center( rx.vstack( rx.heading(State.count, size="9"), rx.hstack( rx.button( "Decrement", color_scheme="red", on_click=State.decrement, ), rx.button( "Increment", color_scheme="green", on_click=State.increment, ), ), spacing="5", ), width="100vw", height="100vh", ) app = rx.App(state=State) app.add_page(index, route="/")
reflex --version
Debug
Known issues
breakingReflex was formerly known as Pynecone. Upgrading from Pynecone (versions < 0.5.0) to Reflex (0.5.0+) involves significant API changes and is not a direct in-place upgrade.
fix
Review the migration guide on the official Reflex documentation for detailed instructions. It's often easier to start a new Reflex project and port your Pynecone logic.
affects: <0.5.0 to >=0.5.0
gotchaEvent handlers in Reflex must be references to methods/functions, not function calls. Forgetting this will cause the handler to execute immediately instead of on the event.
fix
Pass the method/function name directly: `on_click=State.my_method` instead of `on_click=State.my_method()`.
affects: All versions
gotchaSometimes, frontend changes might not reflect immediately due to browser or Reflex's build cache. This can lead to frustration during development.
fix
Try clearing your browser cache or run `reflex run --clear-cache` to force a rebuild of the frontend assets.
affects: All versions
deprecatedThe `app.compile()` method for deploying apps is deprecated. Application deployment is now managed automatically when calling `reflex deploy`.
fix
Remove any calls to `app.compile()`. Define your app with `app = rx.App(state=State)` and use `app.add_page(page_component, route='/')` for each page. Deployment is handled by the `reflex deploy` CLI command.
affects: >=0.6.0
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'reflex'
The Reflex library is not installed in your current Python environment.
fix
Run `pip install reflex` in your active Python environment.
reflex: command not found
The Reflex CLI executable is not in your system's PATH. This often happens if Reflex was installed in a virtual environment that is not activated, or if the installation was incomplete.
fix
Ensure your virtual environment is activated before running `reflex` commands. If you're not using a virtual environment, verify `pip install reflex` completed successfully and your PATH is correctly configured for Python scripts.
Error: The backend server failed to start.
This generic error can indicate several issues, such as the default port (8000) being in use, a corrupt `reflex` project setup, or conflicts with other applications.
fix
Try changing the backend port with `reflex run --backend-port <new_port>`. If the issue persists, ensure no other process is using port 8000. For project corruption, consider `reflex init --clear-cache` or regenerating the project.
Changes in my Python code are not updating in the browser.
The Reflex development server might not be correctly detecting file changes, or the browser cache is serving an old version of the frontend.
fix
First, ensure `reflex run` is still active and hasn't crashed. If it is, try hard refreshing your browser (Ctrl+Shift+R or Cmd+Shift+R). If the problem persists, stop the server and restart it with `reflex run --clear-cache`.
Upgrade
Version history
0.9.5.post2latest on PyPI · released Jun 10, 2026
Audit
Dependencies
pythonrequiredRequires Python 3.10 or higher, but less than Python 4.0
Agent activity
23 hits · last 30 days
node
22
OpenAI (training)
1
Resources
reflex — pip install reflex · libregistry