Install Jupyter & pandas

Learn to install Jupyter Notebook and pandas in this step-by-step Python tutorial. Set up your environment, verify the installation, and get ready for hands-on data analysis in the next lesson.

Focus: install jupyter notebook and pandas

Sponsored

Ever tried to import pandas and hit ModuleNotFoundError: No module named 'pandas'? Or opened a Python script, ran a quick data check, and lost the output the moment you closed the terminal? That’s the frustration this lesson solves. By the end of the next ten minutes, you’ll have a clean, reproducible Jupyter Notebook environment with pandas installed and verified — the foundation you need for every data science project that follows in this track.

The problem this lesson solves

Every data scientist starts with the same pain: getting the tools installed and working. The Python interpreter alone is too bare — you need a place to write code incrementally, inspect outputs, and keep results. And you can’t do any real data analysis without libraries like pandas.

But installation is rarely a one-liner. You might:

  • Install Python but forget the package manager (pip) is aligned to your Python version.
  • Install jupyter but not pandas, then wonder why import pandas fails in the notebook.
  • Use a system Python that conflicts with your OS-managed packages, causing cryptic errors.
  • Spend hours debugging paths when a virtual environment would have solved it in minutes.

This lesson removes those roadblocks. You’ll learn what Jupyter and pandas are, why you need both, and how to install them cleanly using best practices. The goal isn’t just to install — it’s to verify the installation and have a repeatable setup for all future lessons in this track.

Core concept / mental model

Think of Jupyter Notebook as your interactive lab notebook — a digital space where you can write code, run it cell by cell, see the results immediately, and add notes or visualizations alongside. Unlike a regular Python script, a notebook lets you iterate on data transformations without re‑running everything from scratch. It’s the de facto standard for exploratory data science.

pandas is the Swiss Army knife for tabular data. It gives you DataFrame — a two‑dimensional labeled data structure that feels like an Excel sheet but is far more powerful. With pandas you can load, clean, filter, group, and aggregate data in just a few lines of Python. It sits on top of NumPy and is a dependency for countless other data science libraries.

Here’s the mental model:

  • Python environment = your toolbox (Python interpreter + installed packages).
  • Jupyter = the workbench where you use the toolbox interactively.
  • pandas = one of the essential tools (a precision saw) inside that toolbox.

You need all three. Jupyter without pandas can’t handle tabular data. pandas without Jupyter works but is less convenient for exploration. Installing both together, in a virtual environment, ensures isolation and avoids system‑wide conflicts.

How it works step by step

Installing Jupyter Notebook and pandas sounds like “run pip install jupyter pandas” — and that’s the core — but doing it correctly involves four steps: set up a virtual environment, install the packages, launch Jupyter, and verify the imports. Each step builds on the previous one and prevents common pitfalls.

Step 1 – Create a project‑specific virtual environment

A virtual environment keeps your project’s dependencies separate from other Python projects. This avoids version clashes — e.g., one project needs pandas 1.5 while another needs 2.0. It also prevents “permission denied” errors when installing packages globally.

Step 2 – Install Jupyter and pandas with pip

pip is Python’s package installer. Running pip install jupyter pandas pulls in Jupyter (the notebook interface) and pandas, along with their required dependencies such as numpy, ipython, and jupyter-core. The command is the same on all platforms once your virtual environment is active.

Step 3 – Launch Jupyter Notebook

The command jupyter notebook starts a local web server and opens your default browser at http://localhost:8888. You’ll see a file browser in the browser — this is your workspace. From there you can create a new notebook by clicking “New” → “Python 3”.

Step 4 – Verify the installation inside a notebook cell

Open a new cell and type import pandas as pd followed by print(pd.__version__). If you see a version number (e.g., 2.2.2), installation succeeded. This verification step confirms both Jupyter and pandas are wired correctly.

Hands-on walkthrough

Let’s do it together. Open your terminal (Command Prompt on Windows, Terminal on macOS/Linux) and follow along.

1. Create a virtual environment

# Create a folder for your data science project
mkdir my_data_science
cd my_data_science

# Create a virtual environment named 'venv'
python -m venv venv

Expected output: no output, but a new folder venv appears. That’s your isolated Python world.

2. Activate the environment

# On Windows (Command Prompt)
venv\Scripts\activate

# On macOS / Linux
source venv/bin/activate

Expected output: your terminal prompt now shows (venv) at the beginning — a sign that the environment is active.

3. Install Jupyter and pandas

pip install jupyter pandas

Expected output: a stream of text ending with Successfully installed jupyter-... pandas-... (and other packages like numpy).

4. Launch Jupyter Notebook

jupyter notebook

Expected output: a few log lines like [I 2025-01-01 10:00:00.000 NotebookApp] Serving notebooks from local directory... and your browser opens.

5. Create a new notebook and run pandas

In the browser, click NewPython 3. A notebook opens with one empty cell. Type this in the cell and press Shift+Enter:

import pandas as pd

print(pd.__version__)

# Create a tiny DataFrame to confirm everything works
scores = pd.DataFrame({
    'student': ['Alice', 'Bob', 'Carla'],
    'score': [92, 85, 88]
})
print(scores)

Expected output:

2.2.2
  student  score
0   Alice     92
1     Bob     85
2   Carla     88

If you see that, you’re all set. The notebook is running Python, pandas is installed, and you can start analyzing data.

Compare options / when to choose what

There are several ways to install and run Jupyter, and each fits a different scenario. Here’s a quick comparison:

Option Pros Cons Best for
pip install jupyter pandas Simple, one command, full control Requires manual environment management Beginners and most projects
Anaconda (conda) Pre‑installed packages, built‑in environment manager Large download (several GB), heavier Beginners who want everything bundled, Windows users
Google Colab No install, free cloud GPU, easy sharing Needs internet, limited offline, data privacy concerns Quick experiments, educational, collaboration
VS Code with Jupyter extension Integrated editor + notebook, excellent debugging More setup, still need to install Python/packages Developers who prefer a full IDE

Recommendation: For this track, use pip in a virtual environment. It’s lightweight, teaches you the underlying tools, and is the most portable across any project. Anaconda is fine if you just want a pre‑packaged experience, but you’ll learn more by doing it manually.

Pro tip: If you’re on Windows and python isn’t recognized, try py (e.g., py -m venv venv) — the py launcher often works when python is missing from PATH.

Troubleshooting & edge cases

Installation rarely goes perfectly on the first try — that’s normal. Here are the most common errors you’ll hit and how to fix them.

pip: command not found or pip is not recognized

Cause: pip isn’t on your system PATH. Fix: Run python -m pip instead of pip. If that works, use python -m pip install jupyter pandas. To make pip available globally, add Python’s Scripts directory to your PATH (see your OS documentation).

ModuleNotFoundError: No module named 'pandas' inside a notebook

Cause: The notebook is using a different Python interpreter than the one where pandas was installed — a classic pitfall when you have multiple Python versions worldwide. Fix: While your virtual environment is active, run jupyter notebook. That ensures the notebook uses the Python from venv. Inside a notebook cell, run import sys; sys.executable to see which Python it’s using — the path should point inside your venv folder.

PermissionError: [Errno 13] Permission denied during pip install

Cause: You’re trying to install globally into a system‑protected directory. Fix: Always use a virtual environment. If that’s not the issue, add --user to pip install, but using venv is the cleaner solution.

Jupyter launches but the browser doesn’t open automatically

Cause: Sometimes the browser detection fails. Fix: Copy the URL from the terminal (it looks like http://localhost:8888/tree?...) and paste it into your browser manually. Also check that the terminal tab where you ran jupyter notebook stays open — it’s the server process.

Wrong Python version

Cause: pandas may require a specific Python version (e.g., pandas 2.x requires Python 3.9+). If you’re on Python 3.8, you may get build errors. Fix: Install Python 3.10+ using the official installer or a version manager like pyenv. This track assumes Python 3.10+ anyway.

What you learned & what's next

You’ve now installed Jupyter Notebook and pandas, created a virtual environment, launched a notebook, and verified pandas works with a tiny DataFrame. You understand that Jupyter gives you an interactive canvas and pandas gives you the data‑manipulation superpowers — and you know how to fix the most common installation pitfalls.

You are now ready to load and inspect real data with pandas — the focus of the next lesson in this track: reading CSV files with pd.read_csv(), exploring DataFrames with .head() and .info(), and understanding basic data types. That’s where the real data science begins.

Run your first notebook, create a small DataFrame, and then move on — you’ve got a working environment, and the data insights are waiting.

Practice recap

Now, create a new notebook cell and build a small DataFrame with your own data — maybe three tasks you completed today and a rating for each. Use df.describe() to view summary statistics. If that works, you’re fully ready for the next lesson on loading real datasets.

Common mistakes

  • Running jupyter notebook outside the virtual environment, so the notebook uses a different Python that doesn’t have pandas installed.
  • Using pip install pandas while pip belongs to a different Python version than the one running the notebook — check with !python --version inside a cell.
  • Forgetting to activate the virtual environment before each new terminal session — you must re‑run source venv/bin/activate or venv\Scripts\activate every time.
  • Typing jupyter instead of jupyter notebook — the former starts an interactive terminal, not the web‑based notebook.

Variations

  1. Use conda create -n myenv python=3.10 jupyter pandas for a one‑command environment creation if you prefer Anaconda's ecosystem.
  2. Instead of pip, try python -m pip install jupyter pandas to avoid PATH issues on Windows.
  3. For a headless workflow, install jupyterlab instead of jupyter — it's the next‑generation interface that works the same way.

Real-world use cases

  • A data analyst uses a Jupyter Notebook with pandas to clean a messy CSV export, filtering out null rows and renaming columns before the quarterly report.
  • A research scientist writes a reproducible notebook that loads experimental sensor data into pandas, computes summary statistics, and shares the notebook with collaborators.
  • A developer prototyping an ML pipeline quickly tests feature engineering steps on a sample DataFrame in Jupyter before committing the final script to production.

Key takeaways

  • Always create and activate a virtual environment before pip‑installing packages to isolate dependencies.
  • One command — pip install jupyter pandas — installs both the interactive notebook and the data‑analysis library.
  • Launch Jupyter with jupyter notebook while the environment is active to ensure the notebook uses the correct Python.
  • Verification is mandatory: run import pandas as pd; print(pd.__version__) to confirm installation.
  • Common errors have simple fixes: PATH issues, wrong interpreter, and missing activation are the top three.
  • A clean, verified setup is the foundation for every future data science lesson in this track.

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.