Ravindra BagaleCourses & study guides मराठी Track your progress

2. Setup: Python, Jupyter, and Packages

Data Science

2.2 Project Folder and venv

Why. Course labs should not mix with other projects. A venv keeps pandas and friends inside one box.

What. A project folder holds notebooks and data. A venv is a private Python package set for that folder.

How.

Steps — venv

  1. mkdir datascience-labs then cd datascience-labs.
  2. Create venv: python -m venv .venv (or python3 -m venv .venv).
  3. Activate:
    • Windows CMD: .venv\Scripts\activate.bat
    • Windows PowerShell: .venv\Scripts\Activate.ps1
    • Linux / macOS: source .venv/bin/activate
  4. Your prompt should show (.venv).

Example — check you are inside the venv

which python
python -c "import sys; print(sys.prefix)"

What it means. The path should end under datascience-labs/.venv. If it points to a system Python, activate again.

Ravindra Bagale's Tip

Keep one folder for this course (for example datascience-labs). Always activate the venv before pip install or Jupyter. Deeper pip/venv theory is in py10 — modules, pip and venv.

Next: install the course packages → 2.3 Install Packages (No sklearn).