One project, one env
A virtual environment is a local Python setup for one project. It keeps your packages inside the project folder, not mixed with your system Python.
This matters when your hackathon teammate clones your repo. They should install the same packages you used, not guess from your laptop.
Why it matters
Without an env, you may install packages globally. Later, one project needs requests 2.x and another needs a different version. Your scripts start failing in confusing ways.
A clean env also makes your repo look internship-ready. It shows you know how to make code runnable on another machine.
Create the env
Do each one yourself, then tap it to tick it off. The ticks are only a checklist for you: they are not marked or scored.
0 of 4 done
# macOS / Linux
python3 -m venv .venv
source .venv/bin/activate
which python
which pip
# Windows PowerShell
py -m venv .venv
.venv\Scripts\Activate.ps1
where python
where pipInstall one package
After activation, install packages normally. They go into .venv, not your global Python.
For this track, requests is a common package you will use later when calling APIs. Install it now only if your current script needs it.
pip install requests
python -c "import requests; print(requests.__version__)"Freeze dependencies
Do each one yourself, then tap it to tick it off. The ticks are only a checklist for you: they are not marked or scored.
0 of 5 done
pip freeze > requirements.txt
# See what got saved
cat requirements.txt # macOS / Linux
type requirements.txt # WindowsDo not upload .venv
The .venv folder can be large and machine-specific. Your repo should contain instructions and requirements.txt, not the installed environment itself.
Add .venv to .gitignore so Git does not track it. If you already added it by mistake, remove it from Git tracking.
.venv/
__pycache__/
*.pycRebuild test
Before submitting, test your setup like a teammate would. This catches missing packages and unclear steps.
If you use AI to write setup instructions, ask it for Windows and macOS/Linux commands. Then check every command yourself in a fresh terminal.
deactivate
rm -rf .venv # macOS / Linux
# On Windows, delete the .venv folder from File Explorer
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
python your_script.pyDo this now
Do each one yourself, then tap it to tick it off. The ticks are only a checklist for you: they are not marked or scored.
0 of 5 done