Python Environment Setup for Reflex
This skill handles creating a Python virtual environment and installing Reflex.
Step 1: Check for an existing virtual environment
Look for a .venv directory in the project root:
bashls -d .venv 2>/dev/null
If .venv exists, activate it and skip to Step 3.
bashsource .venv/bin/activate
Step 2: Create the virtual environment
If no .venv exists, determine which tools are available.
Option A: uv is available
Check if uv is installed:
bashuv --version
If uv is found:
-
If no
pyproject.tomlexists, initialize one:bashuv init --bare -
Create the virtual environment:
bashuv venv .venv -
Activate it:
bashsource .venv/bin/activate
Skip to Step 3.
Option B: Fall back to python / pip
If uv is not available, check the Python version:
bashpython3 --version
If the version is older than 3.10, stop and inform the user:
Python 3.10 or newer is required. Please install a more up-to-date version of Python before continuing.
If the version is 3.10 or newer:
-
Create the virtual environment:
bashpython3 -m venv .venv -
Activate it:
bashsource .venv/bin/activate -
Upgrade pip:
bashpip install --upgrade pip
Step 3: Install Reflex
Check if Reflex is already installed:
bashpip show reflex 2>/dev/null
If Reflex is not installed:
If using uv:
bashuv add reflex
If using pip:
bashpip install reflex


