Skip to content
| Marketplace
Sign in
Visual Studio Code>Data Science>Spyder-style Variable ExplorerNew to Visual Studio Code? Get it now.
Spyder-style Variable Explorer

Spyder-style Variable Explorer

Marcus Presutti

|
3 installs
| (0) | Free
Spyder-style Variable Explorer and IPython console for VS Code: run Python files and cells in a console, browse nested objects to any depth, and view DataFrames and arrays with colour-coded cells. Works with Jupyter notebooks too.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Spyder-style Variable Explorer for VS Code

A Variable Explorer and IPython console that work like Spyder's, for Python files (with or without # %% cells), Jupyter notebooks and the Interactive Window.

  • Variables panel (bottom panel, next to Terminal): Name / Type / Size / Value, with rows coloured by type the way Spyder does it. It refreshes after every cell you run.
  • DataFrame / Series / Index viewer: cells coloured by value (Spyder's blue-to-red heat map, per column or across the whole table), sorting by clicking a column header, MultiIndex rows and columns, and smooth scrolling through millions of rows because data loads in chunks as you scroll.
  • NumPy array viewer: works for arrays of any number of dimensions. For 3-D and higher you pick which axes are the rows and columns and choose an index for each of the others.
  • Unlimited nesting: dicts, lists, tuples, sets and arbitrary objects (their attributes, like Spyder's Object Explorer) expand inline to any depth. Arrays and DataFrames found inside open in their own tab, and so do objects inside a DataFrame or array cell (double-click the cell).
  • Read-only. Nothing you do in the viewers changes your data.

Everything stays inside the Variable Explorer panel. Opened objects appear as tabs next to the Variables tab, never as editor pages beside your code. Close a tab with its × or a middle-click.

Install

Search for Spyder-style Variable Explorer in the Extensions view, or run:

code --install-extension marcuspresutti.vscode-spyder

Requirements

  • VS Code 1.85 or newer
  • The Jupyter extension (ms-toolsai.jupyter). It is installed automatically as a dependency.
  • A Python kernel. numpy and pandas are optional and only needed when your variables use them.

Nothing gets installed into your Python environment unless you ask for the IPython console (see below). The first time the explorer needs your kernel, it loads a small helper module (python/vx_helper.py) into that kernel. It lives in sys.modules under a private name and doesn't touch your namespace.

The first time you use it, the Jupyter extension may ask whether this extension may access your kernels. Choose Allow.

Usage

  1. Run a Python file in its IPython console (Run File in IPython Console, or Ctrl+Enter with spyderVx.spyderRunKeys on), or open a .ipynb notebook and run a cell.
  2. Open the Variable Explorer tab in the bottom panel (or run Variable Explorer: Show Variable Explorer from the Command Palette).
  3. Double-click a variable to open it.

Inside viewers:

Where Action
Variables Click a header to sort. Drag a header's right edge to resize the column.
Grid Click a header to sort (ascending → descending → off). Drag a header's right edge to resize the column.
Grid Click or drag to select cells. Shift+click or Shift+arrows extends the selection. Ctrl/Cmd+C copies it as tab-separated text. Ctrl/Cmd+A selects everything.
Grid Double-click a cell holding an object (grey background) to open it.
Tree ▸ or → expands, ← collapses, Enter or double-click opens tables and arrays. ⧉ opens any item in its own panel tab.
All Refresh reloads the view. Auto-refresh reloads it after each cell execution.

Each panel tab stays attached to the notebook it was opened from, so switching notebooks changes only the Variables tab.

IPython console

Like Spyder, every Python file runs in an IPython console: a terminal named IPython: <file> where the code runs, its output appears, and you can keep typing commands. Each .py file gets its own console, and its variables show in the Variable Explorer, updating as soon as anything runs there (from the editor or typed at the prompt).

  • Run File in IPython Console (also in the editor's run ▷ menu) runs the whole file, shown as runfile('file.py').
  • With spyderVx.spyderRunKeys on, Ctrl+Enter / Shift+Enter run cells, selections or the file in it (see below), shown as runcell(1, 'file.py') or runlines(3, 5, 'file.py').
  • Runs use what's in the editor, unsaved changes included. Code runs from the file's folder, and tracebacks point at the file's real lines.
  • Ctrl+C in the console interrupts running code. Restart Kernel and Interrupt Kernel are in the Command Palette. Closing the console's terminal ends its session.
  • Switching to a file switches the Variable Explorer to that file's console.

The console uses the Python interpreter selected for the file (the Python extension's choice, or python.defaultInterpreterPath). It needs jupyter-console in that environment; if it's missing, you're asked whether to install it (with pip, or with uv for environments without pip). An OS-managed Python that doesn't allow installing packages (like Ubuntu's /usr/bin/python3, see PEP 668) is left untouched: instead you're offered a private environment on top of it, which adds only jupyter-console and can still import everything installed for that Python, including your ~/.local packages. Running a file the normal way (python file.py) still works as before but leaves nothing to inspect, since the process ends with the script.

Notebooks and Interactive Windows get a console too: Open IPython Console (or the terminal icon on the Variables view) attaches one to the notebook's own kernel, so what you type there and what the cells do share one session.

Plots from a console don't display inline. If something doesn't work, the Variable Explorer output channel says why.

Spyder-style run keys

Turn on spyderVx.spyderRunKeys to make the run keys in Python files run in the file's IPython console:

You have Ctrl+Enter Shift+Enter
A selection Runs the selected lines (or just the selected text, if it's part of one line) Same
A file with # %% cells Runs the current cell; the cursor stays Runs the current cell and moves to the next one
A file without cells Runs the whole file Runs the whole file

Spyder layout

Turn on spyderVx.spyderLayout (or run Variable Explorer: Use Spyder Layout) to arrange the window like Spyder: files on the left, code in the middle, and a right-hand column with the Variable Explorer on top and the terminal below it. In this layout the IPython console opens automatically once a kernel has run something, and follows the notebook or file you switch to. Drag the column's edge to set its width; VS Code remembers it. Turn the setting off (or run Variable Explorer: Restore Default Layout) to move both back to the bottom panel.

Settings

Setting Default
spyderVx.spyderLayout false Arrange the window like Spyder (see above)
spyderVx.spyderRunKeys false Spyder-style Ctrl+Enter / Shift+Enter in Python files (see above)
spyderVx.excludePrivate true Hide _names
spyderVx.excludeUppercase false Hide ALL_CAPS names
spyderVx.excludeCapitalized false Hide Capitalized names
spyderVx.excludeCallablesAndModules true Hide functions, classes and modules
spyderVx.autoRefreshViewers true Default for each viewer tab's Auto-refresh checkbox

Building from source

The extension is plain JavaScript, so there's no build step, and packaging only needs Python 3:

python3 scripts/package_vsix.py          # -> dist/vscode-spyder-<version>.vsix
code --install-extension dist/vscode-spyder-0.2.0.vsix

You can also use Extensions view → ⋯ → Install from VSIX…. Share the .vsix file with anyone and they can install it the same way.

Development

  • Open this folder in VS Code and press F5 to launch an Extension Development Host with the extension loaded.

  • Python tests (helper logic, plus the real kernel protocol if jupyter_client and ipykernel are installed):

    uv run --with pytest --with numpy --with pandas --with ipykernel --with jupyter_client --with jupyter-console pytest tests
    

Layout

Path Role
src/extension.js Activation, commands, wiring
src/kernelBridge.js Tracks the current notebook or file console, injects the helper and runs calls (notebooks via the Jupyter API)
src/pyConsoles.js, src/pySession.js A console per .py file: starts its kernel, snapshots the editor and types runcell / runfile / runlines into it
src/console.js Consoles attached to notebook / Interactive Window kernels
src/runKeys.js, src/layout.js Spyder-style run keys and window layout
python/vx_client.py Owns a .py console's kernel; relays the extension's requests and reports console activity
python/vx_console.py jupyter console --existing whose Ctrl+C interrupts kernels it didn't start
src/protocol.js The Python snippets sent to the kernel and parsing of the replies
src/variablesView.js The panel webview and its requests to the kernel
python/vx_helper.py Runs inside the kernel: lists variables, walks nested paths, slices and formats data
media/panel.js The tab strip inside the panel
media/variables.js, grid.js, tree.js, text.js The variable list, the virtualised colour-coded table, the nested tree and the text viewer
  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
  • Your Privacy Choices
  • Consumer Health Privacy
© 2026 Microsoft