Machine LearningLesson 2 of 22

ML Setup: Where to Start and What to Install

You need three things to start machine learning: Python, a code editor or notebook, and a way to isolate project packages. Python is the standard language for ML, notebooks let you test ideas quickly, and virtual environments keep projects from breaking each other.

You need three things to start machine learning: Python, a code editor or notebook, and a way to isolate project packages. Python is the standard language for ML, notebooks let you test ideas quickly, and virtual environments keep projects from breaking each other.

Most beginners get stuck installing, not learning. Anaconda bundles Python with key libraries, while a plain Python plus pip plus venv is lighter. Google Colab runs in your browser with free GPU and is ideal if your laptop is slow. Visual Studio Code with the Python extension works for both.

Do not spend a week choosing. Pick one path, verify it with a one-line NumPy import, and start learning. You can switch later without losing anything.

Pick your path

Option A: Anaconda (recommended for beginners) — download Anaconda, create an environment, and launch Jupyter. Option B: Plain Python — install Python 3.10+, then python -m venv ml-env and pip install scikit-learn pandas numpy matplotlib jupyter. Option C: Colab — open colab.research.google.com, no install at all.

BASH
# Option B: minimal setup
python -m venv ml-env
# Windows: ml-env\Scripts\activate
# macOS/Linux: source ml-env/bin/activate
pip install scikit-learn pandas numpy matplotlib jupyter
python -c "import sklearn; print(sklearn.__version__)"

Verify in 30 seconds

After install, run a quick check: import the four libraries and create a tiny array. If it prints without error, your environment is ready. Save this as check.py and run it.

BASH
import sklearn, pandas, numpy, matplotlib
import numpy as np
print(np.array([1,2,3]) * 2)  # [2 4 6]

Syntax

BASH
python -m venv ml-env
source ml-env/bin/activate  # Windows: ml-env\Scripts\activate
pip install scikit-learn pandas numpy matplotlib jupyter
jupyter notebook

Never pip install as admin

Running pip with sudo or as admin pollutes the system Python and breaks future installs. Always use a venv or conda env. This Stack Overflow top answer saves hours of permission errors.

BASH
# Never: sudo pip install pandas
# Always: python -m venv ml-env && source ml-env/bin/activate

Good to know

  • Python 3.10+ is the standard for ML; avoid Python 2.
  • Use a virtual environment per project to avoid package conflicts.
  • Colab gives free GPU and requires no install.

Keep building your ML models

Copy the code, run it locally with pip install scikit-learn pandas, and continue to the next lesson.

→ Next: Python Essentials for Machine Learning