question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add a command to debug a single cell

See original GitHub issue

Issue Report Checklist

  • Searched the issues page for similar reports
  • Read the relevant sections of the Spyder Troubleshooting Guide and followed its advice
  • Reproduced the issue after updating with conda update spyder (or pip, if not using Anaconda)
  • Could not reproduce inside jupyter qtconsole (if console-related)
  • Tried basic troubleshooting (if a bug/error)
    • Restarted Spyder
    • Reset preferences with spyder --reset
    • Reinstalled the latest version of Anaconda
    • Tried the other applicable steps from the Troubleshooting Guide
  • Completed the Problem Description, Steps to Reproduce and Version sections below

Problem Description

If I have cells in my code that take a long time to run, I want to avoid having to re run everything. Yet, if I want to debug just a part of my code, this is what I need to do. It would be great to use a mechanism similar to runcell (called debugcell) to debug a single cell.

The logic is implemented in https://github.com/spyder-ide/spyder-kernels/pull/112, but I wonder if there should be a keyboard shortcut or something to trigger that from spyder.

If https://github.com/spyder-ide/spyder-kernels/pull/112 is merged, should there be a mechanism to trigger the cell debugging? For now I type debugcell('mycell') in the console.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
impact27commented, May 22, 2019

How about just a line in the menu and a keyboard shortcut?

2reactions
ccordoba12commented, May 21, 2019

The simplest way to start debugging a cell is to put

import pdb; pdb.set_trace()

anywhere on it. I don’t think we need more than that, do we?

Read more comments on GitHub >

github_iconTop Results From Across the Web

PyCharm - Run and debug Jupyter notebook code cells
Ctrl+Enter : Runs the current cell. · Shift+Enter : Runs the current cell and select the cell below it.
Read more >
Attach to running processes with the Visual Studio debugger
Attach to a process on a remote computer · In Visual Studio, select Debug > Attach to Process (or press Ctrl+Alt+P) to open...
Read more >
using ipdb to debug python code in one cell (jupyter or Ipython)
Use from IPython. core. debugger import set_trace and then place set_trace() where breakpoint is needed.
Read more >
Working with Jupyter code cells in the Python Interactive window
Note: By default, Debug Cell just steps into user code. If you want to step into non-user code, you need to uncheck Data...
Read more >
Important Information on Debug Commands - Cisco
Refer to the appropriate Cisco Debug Command Reference documentation for ... if you have a router with one basic rate interface (BRI), debug...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found