A · Setup · beginner · Week 1 · Chapter 2 of 13
Virtual environments & toolchain
Never pollute global Python. venv per project. pip install inside venv. requirements.txt for reproducibility.
Path progress10%
Step 1 of 3
Create and activate venv
python -m venv .venv creates an isolated environment. Activate before every session.
Example
python -m venv .venv
# macOS / Linux
source .venv/bin/activate
# Windows
.venv\Scripts\activate
python --version
pip --versionDo this now
Create .venv in py-journey. Activate. Run which python (or where python on Windows).
Was this step clear?
Chapter learning outcomes
- python -m venv
- activate/deactivate
- pip install
- requirements.txt
Clear these before you leave
Side quest
Fresh clone drill
Delete .venv, recreate, pip install -r requirements.txt — still works.