ποΈProject WITHOUT React/Vite (Python backend + plain HTML/CSS/JS frontend)
Backend:
source .venv/bin/activate
python app.py
Frontend (no build tool needed β just serve the static files):
python3 -m http.server 5500
or right-click index.html β "Open with Live Server" if you're in VS Code.
βοΈ Project WITH React/Vite (Python backend)
Backend:
source .venv/bin/activate
python app.py
Frontend:
npm run dev
ποΈ *Deleting a virtual environment
*
deactivate
rm -rf .venv
β¨** Creating a fresh one
**
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
π First time in a project only do:
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
π Every time after:
source .venv/bin/activate
python app.py
π Check if venv exists:
ls -a β spot .venv in the list
β
Check if venv is actually active:
which python β should point inside .venv
β οΈ don't fully trust the (.venv) label in your prompt β it can lie!
β»οΈ Only redo the first-time steps if:
ποΈ you delete .venv
π» you're on a new machine
π¦ requirements.txt got new packages
Top comments (0)