Reviewed by Aditya Kumar Ā· Last reviewed 2026-03-24
**Why Venvs:** Isolate dependenciesāProject A needs pandas 1.3, Project B needs 2.0. Avoid conflicts. Reproducible: requirements.txt + pip install -r. **Workflow:** python -m venv env; source env/bin/activate (Unix) or env\Scripts\activate (Win). pip freeze > requirements.txt...
Why Venvs: Isolate dependenciesāProject A needs pandas 1.3, Project B needs 2.0. Avoid conflicts. Reproducible: requirements.txt + pip install -r.
Workflow: python -m venv env; source env/bin/activate (Unix) or env\Scripts\activate (Win). pip freeze > requirements.txt for lock.
Production: Docker for true isolation (OS + Python + deps). Conda for data science (non-Py deps). In pipelines: CI builds from requirements.txt; each service has own image. Pin versions in prodāno floating deps.
python -m venv .venv && .venv\Scripts\activate
Red Flag: Committing venv to git. Pro-Move: 'We use pip-tools (pip-compile) for layered requirementsābase + prod pins.'
According to DataEngPrep.tech, this is one of the most frequently asked Python/Coding interview questions, reported at 1 company. DataEngPrep.tech maintains an editor-reviewed database of 1,863 data engineering interview questions across 7 categories.