Guide
Cursor for Jupyter Notebooks: Setup, Debugging, Limits
Cursor edits Jupyter notebooks like any file once you install the Jupyter extensions from its marketplace. Use Ask mode to understand a notebook, add the failing cell to chat to debug paths and virtual-environment imports, and plan charts before building. The catch: Cursor cannot reliably run cells for you, so you still execute them by hand.
On this page
- How do I set up Jupyter notebooks in Cursor?
- How do I understand a notebook I didn't write?
- How do I debug a failing cell in Cursor?
- How does Cursor fix local path and dependency errors?
- How do I plan a data visualization before building it?
- Can sub-agents build several charts in parallel?
- How do I keep a long notebook session from degrading?
- What can't Cursor do with Jupyter notebooks?
- Can Cursor turn an Excel file into a notebook?
How do I set up Jupyter notebooks in Cursor?
Install the Jupyter extensions from Cursor's extensions marketplace, then open the notebook. Cursor's marketplace works much like the VS Code one, so the notebook tooling you already rely on is there. In the demo the presenter installed the relevant Jupyter extensions published by Microsoft's tools team and checked them by publisher and download count before trusting them.
- 1Open the extensions marketplace in Cursor and search for the Jupyter notebook extensions.
- 2Install the official Microsoft-published ones; verify by publisher name and download count.
- 3Open your .ipynb file. Cursor renders cells inline the way VS Code does.
- 4Keep a terminal pane open at the bottom for shell and git commands, and an Agents pane for the work.
Cursor publishes role-specific cookbooks - workflow recipes for different jobs. The data-science cookbook covers notebook development plus connecting to database frameworks (Supabase, Postgres) and extensions for BigQuery, SQLite and Snowflake. It is the recommended starting point if you are figuring out how to fold Cursor into a data workflow.
How do I understand a notebook I didn't write?
Switch the agent to Ask modeA read-only mode for asking questions about a codebase without changing files; the safe way to explore unfamiliar or legacy code. and point it at the notebook. Ask mode answers questions and never edits, so it is safe to explore with. The presenter opened an unfamiliar Fitbit-analysis notebook and asked what it did plus which charts she could add; Cursor inspected the cells, summarized the SQLite-backed workflow, and suggested chart ideas. When one suggestion was unclear, she drilled in - "I don't understand activity composition, explain more" - and got a plain-language breakdown.
Because Ask modeA read-only mode for asking questions about a codebase without changing files; the safe way to explore unfamiliar or legacy code. never implements, a PM or manager can open a notebook purely to grasp what the data is or what engineers are building, with no risk of edits. The mental move: stay in Ask while you are understanding, and only switch to Agent when you actually want a change made.
How do I debug a failing cell in Cursor?
Run the cell, then copy the cell or its error output and add it to chat so the agent gets exactly what you ran. This is the highest-leverage habit for notebook debugging - context is king, and the failing cell is the context. Switch from Ask to Agent when you want Cursor to actually fix it. For a one-line fix, the cell's "fix with agent" affordance or a ⌘K inline edit is faster than a full chat turn.
Interactive diagram. Tab through its regions; each focused region shows its detail in the panel below.
Run, capture the error, hand Cursor the exact cell, let Agent fix it, then re-run by hand and review.
A notebook's rendered output doesn't always copy cleanly into chat. When that happens, copy the whole cell instead of the output - the agent can reproduce the failure from the source.
How does Cursor fix local path and dependency errors?
These are the two errors that bite first in a notebook, and Cursor self-corrects both. A "no such file or directory" error usually means the notebook hard-codes a path from wherever it was authored - a Kaggle path, say - while your files sit in a local workspace. In the demo, Agent diagnosed exactly that and rewrote the path to auto-detect local versus Kaggle and find the data folder relative to the notebook.
Import failures like "pandas could not be resolved" or "matplotlib not installed" are usually the virtual-environment trap: the package lives in your system Python but not in the venv the notebook is actually using. Cursor finds the root cause, installs into the venv, and verifies the import. Models handle this especially well because Python is so heavily represented in their training data, which makes Cursor strong at pip, version and venv frustrations.
- Error you see
- No such file or directory
- Real cause
- Notebook hard-codes an author's path; your files are elsewhere
- What Cursor does
- Rewrites the path to auto-detect local vs original and resolve relative to the notebook
- Error you see
- pandas could not be resolved / module not installed
- Real cause
- Package is in system Python, not the venv the notebook uses
- What Cursor does
- Installs into the active virtual environment and re-verifies the import
- Error you see
- Stale cell output after a fix
- Real cause
- Notebook is still showing an old run
- What Cursor does
- Tells you to re-run the cell; the fix only lands on execution
| Error you see | Real cause | What Cursor does |
|---|---|---|
| No such file or directory | Notebook hard-codes an author's path; your files are elsewhere | Rewrites the path to auto-detect local vs original and resolve relative to the notebook |
| pandas could not be resolved / module not installed | Package is in system Python, not the venv the notebook uses | Installs into the active virtual environment and re-verifies the import |
| Stale cell output after a fix | Notebook is still showing an old run | Tells you to re-run the cell; the fix only lands on execution |
The first errors you hit in a notebook, and how Cursor self-corrects them.
When prepping the notebook, Cursor asked whether to install into a virtual environment or the project, and the presenter chose the venv. Make that choice deliberately up front: a venv keeps the notebook's dependencies reproducible and avoids the system-vs-venv import trap later.
How do I plan a data visualization before building it?
Switch to Plan modeA mode that makes no edits: it researches the codebase and produces an editable plan you review before any code changes. and work out the visualization with Cursor before any cells change. Plan mode loads inside the editor, so you see the plan and the code side by side, and the plan can link straight to the files and snippets a step will touch. That fixes the old pain of a design doc stranded in Notion or Drive, disconnected from the code. You edit the plan directly - delete a chart you don't want and the agent drops it; add a step to ask for testing and it picks that up.
Plan modeA mode that makes no edits: it researches the codebase and produces an editable plan you review before any code changes. can solicit direction before it builds. Its clarification tool surfaces automatically when a prompt is vague, or you can invoke it explicitly. The presenter wrote a skill telling Cursor to ask six or seven questions before making any plan - questions like "How should charts handle multiple user IDs?" or "Which extra domains: sleep, heart rate, active minutes?" Answering those up front beats discovering the wrong assumption after the charts are built.
Cursor's rule of thumb: develop the plan with a high-reasoning frontier model, then implement it with a cheaper, faster in-house ComposerCursor's own fast coding model, tuned for the editor and priced well below frontier models; the recommended day-to-day model for executing a plan. model - the heavy lifting is already in the plan. The team's line for over-spending on implementation is "taking a Lamborghini to the grocery store." Plans can be checked into GitHub for the team or saved to the workspace as a paper trail, and you can run multiple non-conflicting plans at once.
Interactive widget. Tab through its controls; the result updates in the panel below as you change them.
Plan with a thinker, execute with a fast model.
Plan and thorny bugs lean on reasoning models; routine chart implementation runs on Composer. Auto picks for you.
Can sub-agents build several charts in parallel?
Yes. Sub-agents are small agents with a clear persona running inside a larger one - the presenter calls them "baby Cursors." Create one with the create-sub-agentA child agent a main agent spawns to work in parallel with its own context window, handing results back so the parent's context stays clean. skill: a short Markdown file, around 150 lines, that describes the persona, such as a chart-building visualization specialist. Then ask the agent to launch three chart-builder sub-agents and it spins them up side by side, each visible in the sub-agent UI, each building a different chart.
The Cursor-specific lever is per-sub-agentA child agent a main agent spawns to work in parallel with its own context window, handing results back so the parent's context stays clean. model choice. A chart builder doesn't need a top-tier frontier model racking up a bill - an in-house ComposerCursor's own fast coding model, tuned for the editor and priced well below frontier models; the recommended day-to-day model for executing a plan. model or a mid-tier reasoning model is plenty. One real constraint: sub-agents need a reasoning model to orchestrate. A fast standard model can do the work inside a sub-agent, but it can't be the one launching them.
If your sub-agents won't launch, the model is usually the reason - a fast standard implementation model can't orchestrate sub-agents. Drive them with a reasoning model (a frontier model or Cursor's reasoning-capable in-house model), and you can still assign cheaper models to the individual workers underneath.
How do I keep a long notebook session from degrading?
Watch the context-window meter at the bottom of the chat - it shows how much of the window you've used. Past roughly 70 to 80 percent you start to feel degraded performance: a slower agent and weaker responses. Long notebook debugging sessions get there, because every error, cell and tool call adds up. Three moves reclaim space without starting from scratch.
- Move
- /summarize
- What it does
- Condenses the window by stripping unnecessary tool calls (the explore/understanding steps)
- When to use it
- Mid-session, when the meter climbs and answers slow down
- Move
- @past-chats
- What it does
- Pulls a compressed version of a prior conversation into a new chat
- When to use it
- Starting fresh but needing the gist of an earlier thread
- Move
- Fork the chat
- What it does
- Branches a new chat off the current one, carrying its context
- When to use it
- Continuing from a known-good point without the accumulated cruft
| Move | What it does | When to use it |
|---|---|---|
| /summarize | Condenses the window by stripping unnecessary tool calls (the explore/understanding steps) | Mid-session, when the meter climbs and answers slow down |
| @past-chats | Pulls a compressed version of a prior conversation into a new chat | Starting fresh but needing the gist of an earlier thread |
| Fork the chat | Branches a new chat off the current one, carrying its context | Continuing from a known-good point without the accumulated cruft |
Reclaim context budget without losing where you were.
Interactive widget. Tab through its controls; the result updates in the panel below as you change them.
Mixing unrelated tasks or chasing tangents in one window buries the signal under noise — the agent answers your new question through the haze of the old one. One agent, one task.
Context is a scarce resource. One agent, one task.
Past the 70-85% zone, quality slips. Compact, fork, or carry a compressed thread forward before you hit the wall.
What can't Cursor do with Jupyter notebooks?
Be honest about the seams. The main one surfaced repeatedly in the demo: Cursor cannot reliably run notebook cells for you. The agent writes and edits cells well, but executing them is still a manual step - the presenter ran every cell herself and noted there may be a community MCPModel Context Protocol. A standard that lets an AI agent pull in context from outside the repo, like Jira tickets or internal docs. server that closes the gap, but nothing built in. Plan your loop around running cells by hand.
- Cell execution is manual. Cursor edits and reasons about cells; you press run.
- Rendered cell output doesn't always copy into chat - copy the whole cell instead.
- Inline ⌘K edits offer a limited model menu and hide the agent's reasoning; you only accept or reject.
- The agent can't always point to a cell visually inside the notebook; it may tell you what to search for instead.
Every agent change is inspectable from the review panel, including chart-building edits. Always read it. The presenter's answer to "my ability to write code has decreased" is that reviewing generated code is how you keep learning, and an IDE that keeps the code in front of you does that better than a terminal that hides it. Cursor's verbose "here's the issue, here's the fix, here's why" explanations are deliberate for the same reason.
Can Cursor turn an Excel file into a notebook?
Yes - Cursor is strong at importing Excel data into a CSV, dashboard or notebook form. In the demo the presenter pointed it at a large California Department of Education funding spreadsheet and asked it to pull the funding data into a new Jupyter notebook querying that data. For a creative, open-ended task like that, Cursor reached for a brainstorming skill on its own. You can also ask it to display a CSV as a table and it will offer options.
The closing rule of thumb from the session: if you don't know how to do something, ask Cursor, and once it explains your options, then implement. Ask modeA read-only mode for asking questions about a codebase without changing files; the safe way to explore unfamiliar or legacy code. makes that cheap - you learn the move before you commit any edits to the notebook.
Frequently asked questions
Can Cursor run Jupyter notebook cells for me?
Not reliably on its own. Cursor edits and reasons about cells well, but executing them stays a manual step - you press run. There may be a community MCP server that adds cell execution, but it isn't built in, so plan your debug loop around running cells yourself.
What extensions do I need for Jupyter in Cursor?
Install the Jupyter notebook extensions from Cursor's extensions marketplace, which works much like the VS Code one. Use the official Microsoft-published extensions and verify them by publisher and download count. Cursor's data-science cookbook lists the recommended notebook setup.
Why does my notebook say a package isn't installed when it is?
Usually the package is in your system Python but not in the virtual environment the notebook is using. Add the failing cell to chat in Agent mode; Cursor diagnoses the venv-vs-system mismatch, installs into the active venv, and re-verifies the import.
Which mode should I use to understand a notebook without changing it?
Ask mode. It only answers questions and never edits, so you can ask what a notebook does and which charts to add with no risk. Switch to Agent mode only when you actually want a change made, such as fixing a broken path.
How do I plan charts before building them in a notebook?
Use Plan mode. It loads beside your code, links steps to the exact files they'll touch, and you can edit the plan directly. Plan with a reasoning model, then implement with a cheaper Composer model, and let the clarification tool ask questions before it builds.
Why does Cursor slow down during a long notebook session?
The context window fills as errors, cells and tool calls accumulate; past roughly 70-80% you feel degraded performance. Run /summarize to strip unnecessary tool calls, use @past-chats to pull a compressed earlier thread, or fork the chat to continue from a clean point.
Sources & last verified
Cursor ships frequently. Facts verified against primary sources on June 25, 2026.