| name | setup-python-env |
|---|---|
| description | Set up a Python virtual environment and install Reflex. Use when initializing a new Reflex project, setting up a development environment, or when the user needs to create a venv and install dependencies. Load when there is no .venv directory, when the user asks to start a new Reflex app, or when imports fail due to missing packages. |
This skill handles creating a Python virtual environment and installing Reflex.
Look for a .venv directory in the project root:
ls -d .venv 2>/dev/nullIf .venv exists, activate it and skip to Step 3.
source .venv/bin/activateIf no .venv exists, determine which tools are available.
Check if uv is installed:
uv --versionIf uv is found:
-
If no
pyproject.tomlexists, initialize one:uv init --bare
-
Create the virtual environment:
uv venv .venv
-
Activate it:
source .venv/bin/activate
Skip to Step 3.
If uv is not available, check the Python version:
python3 --versionIf 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:
python3 -m venv .venv
-
Activate it:
source .venv/bin/activate -
Upgrade pip:
pip install --upgrade pip
Check if Reflex is already installed:
pip show reflex 2>/dev/nullIf Reflex is not installed:
uv add reflexpip install reflex