machine learning environment setup

Setting Up Your Machine Learning Environment: Jupyter, Scikit-learn & Colab

Every great recipe still needs a kitchen. You can have the best instructions in the world, but without a stove, a few bowls, and a working set of tools, nothing gets cooked. Machine learning code behaves the same way. In Episode 20 of the Intelevo series, we shift focus from what to write to where to run it, and this article gives you the full machine learning environment setup we walk through in the video.

If you have followed Episodes 11 through 19, you already know the recipes: linear algebra, statistics, probability, calculus, NumPy, pandas, and data visualization. This episode builds the kitchen those recipes cook in. By the end, you will have Jupyter Notebook, scikit-learn, and Google Colab ready to go, and you will know exactly which one to reach for in any situation.

Watch the full video walkthrough above, then use this article as your reference while you follow along.

Why a Machine Learning Environment Setup Comes First

Here’s a scenario worth imagining. Someone hands you a brilliant recipe, but there is no stove, no knives, and no bowls in sight. The recipe itself is not the problem. The kitchen is missing. Machine learning code works exactly this way. Even flawless code goes nowhere without a place to run it.

Consequently, a proper machine learning environment setup removes every excuse before you start a project. You stop worrying about missing packages, broken installs, or “it worked on my laptop” moments. Instead, you focus entirely on the model itself. That shift alone saves hours across a real project.

Meet the Three Pieces of Your ML Kitchen

Three tools form the backbone of almost every machine learning workflow.

  • Jupyter Notebook acts as your countertop. It gives you a space to write and run code one small step at a time.
  • Scikit-learn acts as your toolbox. It hands you ready-made algorithms for regression, classification, and clustering.
  • Google Colab acts as a rental kitchen. It runs in your browser, needs no installation, and even throws in a free GPU.

Together, these three pieces turn a bare laptop into a place where real models get built. Let’s walk through each one, starting with the countertop.

Jupyter Notebook: Your Interactive Countertop

Jupyter Notebook lets you run one small piece of code at a time and see the result immediately below it. This beats writing an entire program blind and hoping it works later.

Think of a lecture hall first. A lecture forces you to sit through the whole talk before you get to ask a question. A lab notebook works differently. You try one step, observe the outcome, and then move to the next. Jupyter mirrors that lab notebook, except it runs code instead of chemistry experiments.

Here is the entire idea in four lines:

python

print("Hello, Intelevo!")
2 + 2
# Out: Hello, Intelevo!
# Out: 4

Notice how the output appears directly beneath the code. Nothing about this feels blind. Every cell becomes a small experiment, and you can run it, observe it, and adjust it before moving forward.

Two Cell Types, One Notebook

A notebook mixes two kinds of cells, and each one plays a distinct role.

  • Code cells run actual Python and display the output right there.
  • Markdown cells hold plain-text notes, headings, and explanations beside the code.

Behind these cells sits the kernel, the engine that remembers every variable as you move from one cell to the next. Together, these pieces let a notebook read like a recipe card: notes on one line, steps on the next, all on a single page.

Installing Jupyter in Two Commands

Getting Jupyter running takes only two steps.

bash

pip install notebook
jupyter notebook

Run the first command once. Run the second command whenever you want to start working. A browser tab opens automatically, and that tab becomes your countertop for the session.

Scikit-learn: A Toolbox Full of Ready-Made Tools

Once your countertop is ready, you need actual tools to work with. That is exactly where scikit-learn comes in. It packages ready-built machine learning algorithms, including regression, classification, and clustering, so you never need to code the underlying math from scratch.

Picture a home repair task. You do not forge a hammer before hanging a picture frame. Instead, you open a drawer and grab one that already exists. Scikit-learn behaves like that drawer, except it stores machine learning tools instead of hardware.

python

from sklearn.linear_model import LinearRegression

model = LinearRegression()
model.fit(X, y)
# the algorithm, ready in two lines

Two lines import the algorithm and fit it to your data. No manual gradient descent, no handwritten optimization loop. Every model built later in this series starts with a tool that already sits in this drawer.

Installing and Verifying Scikit-learn

A single command installs the entire library.

bash

pip install scikit-learn

Afterward, confirm the install by importing it and printing the version.

python

import sklearn
print(sklearn.__version__)
# Out: 1.5.2

If a version number prints back without errors, the toolbox is open and ready. By the way, if you already use Anaconda, scikit-learn, NumPy, and pandas typically arrive pre-installed. This check simply confirms that everything sits where it should.

Google Colab: The Kitchen You Rent, Not Buy

Sometimes, installing anything at all feels like too much friction. Maybe your laptop is new, your office machine is locked down, or you just want to test an idea quickly. That is exactly when Google Colab becomes valuable.

Colab runs Jupyter Notebook inside your browser, directly on Google’s own computers. Nothing gets installed locally, and Colab even offers a free GPU for heavier training tasks later in this series.

Renting a fully-equipped kitchen for one evening beats buying an oven you will only use twice. Similarly, Colab hands you Python, Jupyter, and scikit-learn already installed, completely free, right inside your browser tab.

Colab in Three Simple Steps

Starting a Colab session takes barely a minute.

  1. Visit colab.research.google.com and sign in with any Google account.
  2. Click New Notebook. A blank countertop appears instantly.
  3. Type code into the first cell, then press Shift + Enter to run it.

python

!pip install scikit-learn
import sklearn
print("Kitchen ready:", sklearn.__version__)

Notice the exclamation mark before pip install. That single symbol lets Colab install packages directly inside a running notebook cell. No separate installation step ever appears, because Google already handled it behind the scenes.

Jupyter vs Colab: Which Should You Choose?

Both tools solve real problems, yet they solve different ones. The table below breaks down the difference at a glance.

JupyterColab
What it isRuns on your own computerRuns on Google’s computers, in your browser
AnalogyYour own kitchen at homeA rented kitchen, fully stocked
In one linejupyter notebookcolab.research.google.com

Neither option wins in every situation. Choose Jupyter when you want full control over your local files and packages. Choose Colab when you need a GPU quickly, or when you simply want zero setup.

A Quick Gut-Check

Try this scenario before moving on. Your laptop has no Python installed, and you need a free GPU for just a few hours. What is the fastest, correct way to start?

  • A. Install Anaconda, Jupyter, and GPU drivers first
  • B. Open Google Colab and start a new notebook
  • C. Ask a friend to email their notebook file
  • D. Wait until you can buy a new laptop

The answer is B. Colab already has Python, Jupyter, and a GPU switched on, so you simply walk in and start working.

You Have Already Used This Idea Before

Interestingly, this local-versus-cloud idea already exists in your daily life, just not inside code yet.

  • Google Docs lets everyone edit inside a browser, with nothing installed, just like Colab.
  • A lab notebook logs one step at a time, with notes sitting beside the work, just like Jupyter.
  • Flat-pack furniture ships with pre-made parts that you simply assemble, rather than forge yourself, just like scikit-learn.
  • Streaming a movie uses the cloud instead of requiring you to buy a projector and screen, just like Colab again.

In short, you already navigate the trade-off between local ownership and rented convenience every day. This episode simply brings that same trade-off into your machine learning workflow.

Test Drive Your Complete Setup

Before wrapping up, run one final check to confirm every piece of your machine learning environment setup works together.

python

import numpy as np
import pandas as pd
import sklearn
import matplotlib

print("NumPy:", np.__version__)
print("Pandas:", pd.__version__)
print("scikit-learn:", sklearn.__version__)
print("Matplotlib:", matplotlib.__version__)

Four imports produce four version numbers. If every line prints without a red error, your kitchen has power, water, and every appliance plugged in and ready. Run this exact cell before starting any project later in this series, and you will catch missing packages before they slow you down.

Pro Tips to Keep Your Kitchen Clean

A few small habits prevent most setup headaches later.

First, use a virtual environment for each project, whether through venv or conda. This keeps ingredients from different recipes from mixing together.

Next, save a requirements.txt file. Think of it as a shopping list that lets anyone, including future you, rebuild your exact kitchen later.

Additionally, restart the kernel whenever a notebook feels stuck. This works like switching a stove off and back on, and it clears out old, half-cooked state.

Finally, on Colab specifically, save your work often. A disconnected session can clear everything that was not saved to your Drive, so do not take chances with long-running experiments.

Common Installation Errors and Quick Fixes

Even a clean machine learning environment setup runs into small snags sometimes. Fortunately, most issues trace back to just a handful of causes.

  • “pip: command not found.” This usually means Python itself is missing, or it is not added to your system path. Reinstall Python from python.org and make sure you check the box that adds Python to PATH during setup.
  • “ModuleNotFoundError” after installing a package. This often happens when you install a package into one Python environment but run your notebook from another. Activate the correct virtual environment first, then reinstall the package inside it.
  • Jupyter opens, but the kernel keeps dying. Large datasets or memory leaks usually cause this. Restart the kernel, clear all outputs, and rerun cells from the top instead of trying to fix a single broken cell mid-session.
  • Colab session disconnects mid-training. Free Colab sessions have time limits, especially during high-traffic periods. Save checkpoints to Google Drive periodically, so a disconnect never costs you an entire training run.

Once you recognize these patterns, troubleshooting stops feeling random. Instead, it becomes a short checklist you can run through in under a minute.

Do You Still Need Anaconda?

Many learners ask whether Anaconda remains necessary once Jupyter, scikit-learn, and Colab are all set up. The honest answer is that it depends on your workflow. Anaconda bundles Python, Jupyter, and hundreds of data science packages into a single installer, which saves time on a new machine. However, it also uses more disk space and adds an extra layer between you and plain pip.

If you prefer a lightweight setup, stick with plain Python plus pip install notebook and pip install scikit-learn, exactly as shown above. If you prefer everything bundled together with less manual installation, Anaconda remains a solid choice. Either path leads to the same working kitchen, so pick whichever one matches how you like to work.

Where This Leaves You

At this point, your machine learning environment setup covers three solid pieces. Jupyter gives you an interactive countertop. Scikit-learn gives you a toolbox full of proven algorithms. Colab gives you a rental kitchen whenever local setup gets in the way.

As a result, every notebook you write from here forward has somewhere real to run. That single fact removes one of the biggest obstacles beginners face, since broken environments stop more projects than difficult math ever does.

What’s Coming Next

In Episode 21, we move from the kitchen itself to the ingredients: Datasets 101: Features, Labels, and Train/Test Split. Now that your workspace stands ready, it makes sense to bring in the data itself and start shaping it into something a model can actually learn from.

Watch, Subscribe, and Join the Conversation

If this walkthrough helped clarify your machine learning environment setup, please like the video, subscribe to Intelevo, and share it with anyone starting their own machine learning journey. Comments genuinely help shape future episodes, so let me know which part clicked and which part deserves a slower, deeper explanation.

You can also find this full write-up on intuitivetutorial.com, and the link sits in the video description box as well as the pinned first comment, so you can take notes at your own pace. Thank you for reading, and see you in Episode 21.

Leave a Comment

Your email address will not be published. Required fields are marked *