Install Jupyter Notebook and pandas

Install Jupyter Notebook and pandas — Python for data science. Step-by-step setup for your data analysis environment.

Focus: install jupyter notebook and pandas

Sponsored

You’ve written a few Python scripts, maybe printed a DataFrame or two, but now you’re staring at a blank terminal and wondering: where do I actually start doing data science? The answer is simple — you need the right environment. Jupyter Notebook gives you an interactive canvas where code, charts, and notes live side by side, and pandas gives you the data structures that make analysis feel almost effortless. Without them, you’re stuck writing endless loops and print statements. In this lesson, you’ll install Jupyter Notebook and pandas on your machine, verify everything works, and write your first real data analysis snippet — setting the foundation for everything else in this track.

The problem this lesson solves

Most beginners jump straight into data analysis with plain Python scripts. That works for a few lines, but the moment you need to inspect intermediate results, tweak a filter, or visualize a trend, you’re re-running the whole file. Painful. Worse, without the right libraries, you’ll find yourself reinventing basic operations like grouping, joining, or handling missing values — hours of code that pandas gives you in one line.

This lesson solves that by giving you a clean, reproducible data science environment. You’ll learn to install Jupyter Notebook and pandas, so you can:

  • Write and run code in small, interactive cells.
  • Keep notes and visualizations next to your code.
  • Use pandas’ DataFrame and Series to manipulate data without writing low-level loops.

By the end, you’ll have a working setup that lets you focus on analysis, not environment headaches.

Core concept / mental model

Think of Jupyter Notebook as a lab notebook for code. Each cell is a separate step: you can write a line, run it, see the result immediately, and then keep going. It’s the difference between cooking an entire meal blindfolded and tasting each ingredient as you add it.

pandas is your data workbench. It introduces two key structures:

  • Series — a labeled one-dimensional array (like a column).
  • DataFrame — a labeled two-dimensional table (like a spreadsheet with column names and row indices).

You can almost think of a DataFrame as a Python dictionary of Series objects. This mental model will help you later when you’re selecting columns, filtering rows, or merging datasets.

Together, Jupyter Notebook + pandas creates a feedback loop: you load data, poke at it, visualize it, and iterate — all without losing context.

How it works step by step

Installing Jupyter Notebook and pandas is a three-stage process: prepare your environment, install with pip, and verify the install. Here’s the high-level flow:

  1. Install Python (if you don’t have it yet). Most systems come with Python 3.8+, and Python 3.10+ is recommended for this track.
  2. Create a virtual environment — this keeps your project dependencies isolated from your system Python. You’ll avoid version conflicts later.
  3. Install Jupyter Notebook using pip install notebook. This brings the classic notebook interface.
  4. Install pandas with pip install pandas. It will also install numpy as a dependency, which you’ll use later in this track.
  5. Launch Jupyter with jupyter notebook. Your browser opens a dashboard where you can create a new notebook.
  6. Verify by importing pandas and checking the version.

That’s it. Each step builds on the previous one — if Python isn’t installed correctly, nothing else will work. If you skip the virtual environment, you risk dependency chaos down the road.

Hands-on walkthrough

Step 1: Check Python and set up a virtual environment

Open your terminal (Command Prompt on Windows, Terminal on macOS/Linux) and type:

python --version

You should see something like Python 3.11.5. If not, install Python 3.10+ from python.org. Then create a project folder and a virtual environment:

mkdir data-science-project
cd data-science-project
python -m venv venv

Activate it:

  • Windows: venv\Scripts\activate
  • macOS/Linux: source venv/bin/activate

Your prompt should change to show (venv) — that means you’re inside the environment.

Step 2: Install Jupyter Notebook and pandas

Now run:

pip install notebook pandas

This one command installs both Jupyter Notebook and pandas, plus all their dependencies. You’ll see a bunch of progress lines — that’s normal. If you’re on a machine with both Python 2 and Python 3, you might need pip3 instead of pip.

Step 3: Launch Jupyter and create a notebook

Start the notebook server:

jupyter notebook

Your default browser will open a dashboard at http://localhost:8888. Click NewPython 3 to create a notebook. You’re now inside an interactive cell.

Step 4: Write your first pandas code

In the first cell, type:

import pandas as pd
print(pd.__version__)

Press Shift+Enter to run the cell. You should see a version number like 2.2.2. If that works, congratulations — you’ve installed Jupyter Notebook and pandas successfully!

Now let’s do something slightly more interesting. In the next cell, create a small DataFrame:

import pandas as pd

# Create a simple DataFrame
data = {
    'name': ['Alice', 'Bob', 'Charlie'],
    'score': [85, 92, 78]
}
df = pd.DataFrame(data)
print(df)

Expected output:

      name  score
0    Alice     85
1      Bob     92
2  Charlie     78

Step 5: Save and shut down

Once you’re done, save the notebook with Ctrl+S (or Cmd+S on macOS). You can shut down the server by pressing Ctrl+C in the terminal, then confirming y.

Compare options / when to choose what

There’s more than one way to run Jupyter. Here’s a quick comparison to help you decide what’s right for you:

Option Pros Cons When to use
Jupyter Notebook (classic) Simple, familiar interface; great for beginners Fewer modern features than JupyterLab When you want minimal distraction and a classic feel
JupyterLab Full IDE-like experience; tabs, panels, extensions Slightly more complex for absolute beginners When you want an integrated environment as you grow
VS Code + Jupyter extension Uses your favorite editor; version control and debugging Requires VS Code setup When you already live in VS Code and want a unified workflow
Google Colab (cloud) Zero install; free GPU; easy sharing Requires internet; limited control over environment When you want to experiment quickly without local setup

For this track, we recommend starting with classic Jupyter Notebook because it’s the cleanest way to focus on learning pandas. Once you’re comfortable, explore JupyterLab or VS Code.

Troubleshooting & edge cases

pip: command not found

If your terminal says pip is not recognized, try pip3 or python -m pip. Make sure Python is in your PATH.

jupyter: command not found

This usually means the virtual environment isn’t activated or the installation didn’t complete. Re-check your activation command and rerun pip install notebook.

ModuleNotFoundError: No module named 'pandas'

You might be running a different Python than the one where pandas is installed. Remember to activate your virtual environment every time. Or you accidentally installed pandas system-wide while Jupyter runs from the venv — check by running pip list in the same terminal.

Port 8888 already in use

If another Jupyter server is running, you’ll get an error like Address already in use. You can launch on a different port:

jupyter notebook --port 9999

pandas installs but won’t import

Sometimes there’s a wheel mismatch on older Python versions. Upgrade pip first:

pip install --upgrade pip

Then reinstall pandas.

Kernel crashes when creating a notebook

This can happen when your environment is corrupt. Recreate the virtual environment from scratch — it’s usually faster than debugging.

Pro tip: Always run pip list after an install to confirm what’s actually in your environment. It saves you from “works on my machine” heartache.

What you learned & what's next

You’ve taken the essential first step in your data science journey. You now understand the core idea behind Jupyter Notebook — an interactive, cell-based environment — and pandas — a library that brings spreadsheet-like power to Python. You can:

  • Explain why Jupyter + pandas is the go-to combo for data analysis.
  • Install both tools using a virtual environment and pip.
  • Launch a notebook, write pandas code, and verify the installation.
  • Troubleshoot common setup issues.

You’ve also completed a practical exercise — creating a DataFrame from a dictionary — which is exactly the kind of operation you’ll do constantly.

In the next lesson, you’ll build on this foundation by loading real data into pandas from CSV files. You’ll learn how to read external data, inspect its shape and columns, and get a first taste of EDA (exploratory data analysis). Combined with what you’ve set up here, you’re ready to start manipulating data like a pro.

Keep your notebook open — you’ll use it again soon.

Practice recap

Create a new notebook and write a script that creates a DataFrame with at least five rows and three columns (e.g., product, price, quantity). Use pandas to calculate the total price per product and print the result. This exercises your understanding of environment setup and core pandas operations, preparing you for working with larger datasets in the next lesson.

Common mistakes

  • Installing packages globally instead of inside a virtual environment, which causes version conflicts between projects.
  • Forgetting to activate the virtual environment before running jupyter or python, leading to ModuleNotFoundError for pandas.
  • Running pip install notebook and pip install pandas separately but outside the same environment, so Jupyter doesn't see pandas.
  • Ignoring the terminal output during install and missing a failed dependency — always check for errors or run pip list to verify.

Variations

  1. Use pip install jupyterlab instead of notebook for a more modern, IDE-like interface.
  2. Install via Anaconda distribution, which includes Jupyter, pandas, and many data science libraries pre-installed.
  3. Use pip install pandas separately if you already have Jupyter installed, to avoid pulling the full notebook package.

Real-world use cases

  • A data analyst sets up a fresh environment to explore a sales dataset, using a Jupyter notebook to load CSVs and run quick pandas aggregations.
  • A researcher shares an analysis notebook with colleagues, ensuring the same pandas version and environment for reproducible results.
  • A student completing an online course installs Jupyter and pandas locally to follow along with tutorials and complete homework assignments.

Key takeaways

  • Jupyter Notebook provides an interactive, cell-based environment perfect for iterative data analysis.
  • pandas introduces DataFrame and Series, the core structures for tabular data manipulation.
  • Always use a virtual environment to keep project dependencies isolated and avoid conflicts.
  • The pip install notebook pandas command installs both tools in one step, simplifying setup.
  • Verifying your install with import pandas as pd and checking the version helps catch environment issues early.

Sponsored

Sponsored

Discussion

Questions, corrections, and tips help everyone reading this page.

0 comments

Add a comment

Shown publicly with your comment.

Be constructive · max 4,000 characters

No comments yet — start the thread.

Related tutorials, quizzes, and articles for this topic.