ScreenshotNeo

BlogGuides

Jupyter Notebook for Beginners: A Practical Introduction

Learn what Jupyter Notebook is, install it with pip or Anaconda, run your first cells, understand kernels, and share reproducible notebooks.

By the ScreenshotNeo team29 September 20269 min read

Jupyter Notebook for Beginners: A Practical Introduction

Jupyter Notebook is a web application for creating executable documents that combine code, prose, equations, data and visualizations. You write work in cells, run cells through a language-specific kernel, inspect the output, and save the whole document as an .ipynb file. This makes a notebook useful for learning, exploration, analysis, teaching and sharing results.

The fastest local path is:

python -m pip install notebook
jupyter notebook

For the newer, multi-document interface, install JupyterLab instead:

python -m pip install jupyterlab
jupyter lab

Project Jupyter lists both commands on its official installation page (jupyter.org/install). This guide explains which option to choose, how kernels and cells work, how to create a first notebook, and how to avoid the problems beginners most often encounter.

What Jupyter Notebook is

A notebook is a structured JSON document containing cells, outputs and metadata. A cell can contain executable code or Markdown. When you run a code cell, the kernel executes it and stores the result in the document. A Markdown cell can explain the method, define a variable, include a formula or add links around the code.

Cells are sent to a language kernel, which returns outputs that are saved in the notebook.
Cells are sent to a language kernel, which returns outputs that are saved in the notebook.

That combination is the main difference from a plain script. A script records instructions; a notebook records instructions, the narrative around them and often the resulting tables or plots. The official documentation describes notebooks as shareable documents that combine computer code, plain-language descriptions, data and rich visualizations (Jupyter documentation).

Python is the usual first language, but Jupyter supports many kernels. Official Jupyter pages describe kernels for languages including Python, R, Julia, C++, Ruby and Scheme, among others. A kernel is a running process that executes code in one language and returns outputs to the notebook.

Choose an installation method

pip in a virtual environment

Use pip when Python is already installed and you want a small, explicit environment for one project. A virtual environment keeps notebook packages separate from system Python and from other projects.

python -m venv .venv

# macOS or Linux
source .venv/bin/activate

# Windows PowerShell
.venv\\Scripts\\Activate.ps1

python -m pip install --upgrade pip
python -m pip install notebook
jupyter notebook

Run the command from your project directory. Jupyter opens a local server and normally opens a browser tab. Files created or loaded with relative paths resolve from that directory.

Anaconda or Miniconda

The classic installation guide says, “For new users, we highly recommend installing Anaconda.” Anaconda bundles Python and many scientific packages, so it can be convenient if you expect to use NumPy, pandas, Matplotlib and similar tools immediately. Miniconda is a smaller distribution when you prefer to choose packages yourself.

conda create -n notebooks python=3.12
conda activate notebooks
conda install -c conda-forge notebook
jupyter notebook

Package and Python version requirements change as Notebook releases change. Follow the current official installation page rather than copying a command from an old tutorial.

JupyterLab

JupyterLab uses the same notebook format and kernels but provides tabs, multiple documents, a file browser, terminals and a customizable layout. Install it with:

python -m pip install jupyterlab
jupyter lab

Choose classic Notebook when you want a focused, document-centered interface. Choose JupyterLab when you expect several notebooks, data files, terminals or an IDE-like workspace. You can install both in one environment; the commands simply start different front ends.

Try Jupyter in a browser

Try Jupyter provides temporary browser sessions without a local installation. It is useful for learning the interface or testing a small example. Treat these sessions as disposable: local environments are better for persistent files, custom packages and repeatable projects. Some JupyterLite environments are experimental.

Create and run your first notebook

  1. Create a folder. Make a directory for the project and open a terminal there. Starting Jupyter from this folder keeps relative paths predictable.
  2. Start the interface. Run jupyter notebook or jupyter lab. In the browser, select New and choose a Python kernel.
  3. Run a code cell. Enter the following and press Shift+Enter:
name = "Jupyter"
print(f"Hello, {name}!")

The output appears directly below the cell. The cell is numbered by execution order, such as In [1]. That number reflects when it ran, not where it appears on the page.

  1. Add Markdown. Insert a new cell, change its type from Code to Markdown, and write a heading and explanation:
# A small calculation

This cell explains the calculation in plain language.
  1. Run a calculation and a table.
values = [2, 4, 6, 8]
average = sum(values) / len(values)
{"values": values, "average": average}
  1. Display a plot. If Matplotlib is installed, run:
import matplotlib.pyplot as plt

plt.plot(values, marker="o")
plt.title("Example values")
plt.xlabel("Position")
plt.ylabel("Value")
plt.show()
  1. Save. Use the Save command or press Ctrl+S (Windows/Linux) or Cmd+S (macOS). The result is an .ipynb file.

Cells, kernels and execution order

Cells are independent in the interface but usually dependent in logic. If one cell defines total and a later cell uses it, the later cell only works after the first has run in the current kernel session.

total = 10
# Run this cell first

total * 2
# Then run this cell

You can run cells out of order, which is useful during exploration but dangerous before sharing. The notebook may appear correct while depending on hidden state left by an earlier run. Use Kernel → Restart Kernel and Run All Cells before publishing. This clears in-memory variables and confirms that the document works from a clean start.

Restarting a kernel does not delete the notebook file. It clears variables, imports, open connections and other in-memory state. Re-run setup cells after a restart. If a package was installed while the kernel was running, restart the kernel so it sees the new environment.

Notebook versus JupyterLab

Need Classic Notebook JupyterLab
One focused document Simple and lightweight Works, with more surrounding controls
Several notebooks or files Separate browser tabs Tabbed documents and split panels
Terminal and file management Basic file browser Integrated file browser and terminals
Extensions Smaller interface surface Broader extension and layout model
Learning curve Usually easier for a first notebook Better when you want an IDE-like workspace

Both interfaces open the same .ipynb format and use the same kernels. You can start with classic Notebook and move to JupyterLab later without converting your files.

Install and select additional kernels

Installing a language package is not always enough; the environment must also be registered as a Jupyter kernel. For Python, install ipykernel in the environment you want to use:

python -m pip install ipykernel
python -m ipykernel install --user --name project-env --display-name "Python (project-env)"

Restart Jupyter, then choose Kernel → Change Kernel. The display name is what appears in the menu; the internal name is the value passed to --name. List registered kernels with:

jupyter kernelspec list

For R, Julia or another language, follow that kernel’s official installation instructions. The front end does not translate code; the selected kernel determines which language is executed.

Files, outputs and reproducibility

An .ipynb file stores source cells, displayed outputs and metadata as JSON. That makes it easy to share, but it also creates responsibilities:

  • Remove API keys, passwords, tokens and private customer data before sharing.
  • Clear very large outputs, binary blobs and accidental debug dumps.
  • Record package versions and the Python version in a Markdown cell or environment file.
  • Restart the kernel and run all cells in order before committing the file.
  • Check that relative paths work for another person who clones the project.
  • Use a repository or notebook viewer when readers only need to inspect the result.

Notebook trust controls whether saved HTML and JavaScript outputs are rendered automatically. Only trust notebooks from sources you understand. A notebook can contain executable code, so reviewing it before running is as important as reviewing a script.

Common errors and fixes

Error or symptom Cause Fix
jupyter: command not found The package is installed in another Python environment, or its scripts are not on PATH. Activate the environment and run python -m pip install notebook. You can also start with python -m notebook.
“No module named …” The package is missing from the kernel’s environment. Install it with that environment active, then restart the kernel.
Kernel keeps restarting A broken package, incompatible binary or exhausted memory can terminate the kernel. Check the terminal log, test imports in a clean environment and reduce data size. Recreate the environment if necessary.
Variables behave unexpectedly Cells ran out of order and left hidden state. Restart the kernel and run all cells from the top.
Port already in use Another Jupyter server is using the default port. Stop the old server or start with jupyter notebook --port 8890.
Browser does not open The server is running but no browser integration is available. Copy the URL with its token from the terminal and paste it into a browser.
Plots do not appear The plotting package is absent or the backend is misconfigured. Install Matplotlib, run %matplotlib inline, and execute the plotting cell again.
Relative file path fails Jupyter was started from a different directory. Start it from the project folder or inspect import os; os.getcwd().

Performance, reliability and cost

Notebook performance is mostly determined by the kernel and the data you load. Read only the columns you need, process large files in chunks, avoid displaying millions of rows, and delete unused objects when memory is tight. A notebook interface can remain responsive while a kernel is busy, so watch the execution indicator and terminal logs.

A capture service can remove consent banners and overlays before saving the final page image.
A capture service can remove consent banners and overlays before saving the final page image.

For reliable work, keep setup cells near the top, make dependencies explicit, use deterministic random seeds when appropriate, and save checkpoints before expensive operations. Split a very long exploratory notebook into smaller documents when rerunning everything becomes slow.

Jupyter itself is free and open source. Your practical costs are the computer, storage and any hosted environment or cloud resources you choose. Browser trials are convenient for learning but temporary. A local virtual environment or Conda environment gives you control over package versions and persistent files.

Or skip the browser setup

If your goal is to capture a notebook page or rendered report as an image or PDF, ScreenshotNeo provides a single website screenshot request. It can remove cookie banners, newsletter popups and chat widgets before capture. Bot checks, blank pages, timeouts, failed loads and cache hits are not billed, and the response identifies the result with X-Page-Verdict and X-Billed headers. Its MCP server lets Claude, Cursor and other MCP clients call take_screenshot, get_page_info and capture_pdf.

See the ScreenshotNeo API documentation for all options. This captures the public Jupyter page at the URL you provide:

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://jupyter.org/try -o shot.webp
import requests

r = requests.get("https://api.screenshotneo.com/v1/shot", params={"access_key": "YOUR_API_KEY", "url": "https://jupyter.org/try"}, timeout=90)
open("shot.webp", "wb").write(r.content)
const q = new URLSearchParams({ access_key: 'YOUR_API_KEY', url: 'https://jupyter.org/try' });
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);

Every plan includes the same features: full-page capture with lazy images loaded, CSS-element capture, dark mode, device presets or custom viewports, retina scale, PDF controls, custom CSS and JavaScript, clicks, waits, request blocking, headers and cookies, timezone and geolocation, transparent backgrounds, resizing, TTL caching, signed links, asynchronous webhooks, bulk capture for up to 100 URLs per call, usage data and an OpenAPI specification. The free plan includes 1,000 screenshots each month with no card; paid plans start at $5 for 3,000. Create a free ScreenshotNeo account.

Beginner checklist

  • Choose pip, Conda or a browser trial based on whether you need a persistent environment.
  • Start Jupyter from the project directory.
  • Learn the difference between Code and Markdown cells.
  • Remember that the kernel holds state between executions.
  • Restart and run all cells before sharing.
  • Remove secrets and sensitive outputs from the .ipynb file.
  • Record the environment needed to reproduce the results.

FAQ

Do I need Anaconda to use Jupyter?

No. The official pip installation is sufficient. Anaconda is an optional bundled distribution that the classic guide recommends for new users.

Can I open a notebook without installing Python?

Yes. Try Jupyter provides temporary browser sessions. For persistent projects and custom packages, install locally or use a managed environment.

Why is my output missing after I reopen the file?

Outputs are saved only when the cell has been executed and the notebook has been saved afterward. Run the cell, save the notebook, and confirm the output appears before closing.

Is JupyterLab a replacement file format?

No. JupyterLab and classic Notebook use the same notebook documents and kernels. They are different interfaces for working with those files.

How do I make a notebook reproducible?

Use a dedicated environment, record dependencies, restart the kernel, run every cell in order, remove secrets and test the notebook from a clean checkout.