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.

Step-by-step debugging with IPython console doesn't work in 3.1.4.

See original GitHub issue

Description

After upgrading from Spyder 3.1.3 to 3.1.4, step-by-step debugging with IPython in Spyder doesn’t work anymore as it fails on all programs after a few single-steps with the error “Restarting kernel because an error occurred while debugging”. Single-step debugging the same code in an ipython terminal works fine, so it seems to only be a problem when debugging via Spyder.

What steps will reproduce the problem?

  1. Start the debugger on any program, e.g. the trivial test program below.
  2. Single-step a couple of times for the error to occur. It is not consistent how many single-steps are required before the error occurs, but it is just a few and thus effectively making debugging in Spyder unusable.

What is the expected output? What do you see instead? Single-step debugging should work.

Please provide any additional information below Here is the trivial test program (test.py) used:

for i in range(10):
    print("i = {}".format(i))

The IPython console output when single-step debugging the test program in Spyder is as follows:

Python 3.5.3 (v3.5.3:1880cb95a742, Jan 16 2017, 16:02:32) [MSC v.1900 64 bit (AMD64)] Type “copyright”, “credits” or “license” for more information.

IPython 6.0.0 – An enhanced Interactive Python.

debugfile(‘C:/Users/lars/Desktop/test.py’, wdir=‘C:/Users/lars/Desktop’)

c:\users\lars\desktop\test.py(1)<module>() ----> 1 for i in range(10): 2 print(“i = {}”.format(i)) 3 4

c:\users\lars\desktop\test.py(2)<module>() 1 for i in range(10): ----> 2 print(“i = {}”.format(i)) 3 4

i = 0

c:\users\lars\desktop\test.py(1)<module>() ----> 1 for i in range(10): 2 print(“i = {}”.format(i)) 3 4

ipdb> ipdb> > c:\users\lars\desktop\test.py(2)<module>() 1 for i in range(10): ----> 2 print(“i = {}”.format(i)) 3 4

ipdb> i = 1

c:\users\lars\desktop\test.py(1)<module>() ----> 1 for i in range(10): 2 print(“i = {}”.format(i)) 3 4

c:\users\lars\desktop\test.py(2)<module>() 1 for i in range(10): ----> 2 print(“i = {}”.format(i)) 3 4

ipdb> Restarting kernel because an error occurred while debugging

ipdb> Kernel died, restarting

Version and main components

  • Spyder Version: 3.1.4
  • Python Version: 3.5.3
  • Qt Versions: 5.8.0, PyQt5 5.8.2 on Windows

Dependencies

jedi >=0.9.0     :  0.10.2 (OK)
matplotlib >=1.0 :  2.0.0 (OK)
nbconvert >=4.0  :  5.1.1 (OK)
numpy >=1.7      :  1.12.1 (OK)
pandas >=0.13.1  :  None (NOK)
pep8 >=0.6       :  1.7.0 (OK)
pyflakes >=0.6.0 :  1.5.0 (OK)
pygments >=2.0   :  2.2.0 (OK)
pylint >=0.25    :  1.7.1 (OK)
qtconsole >=4.2.0:  4.3.0 (OK)
rope >=0.9.4     :  0.9.4-1 (OK)
sphinx >=0.6.6   :  1.5.5 (OK)
sympy >=0.7.3    :  None (NOK)

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:3
  • Comments:24 (11 by maintainers)

github_iconTop GitHub Comments

2reactions
ccordoba12commented, May 13, 2017

This bug only happens if you’re using print’s in the middle of a debugging session. Sorry for that, we didn’t consider that case.

To revert to 3.1.3 (3.1.2 has other ugly bugs) you have to run

conda install spyder=3.1.3

or

pip install spyder==3.1.3
1reaction
fscarpa58commented, May 14, 2017

done. thank you

Read more comments on GitHub >

github_iconTop Results From Across the Web

Step-by-step debugging with IPython - Stack Overflow
A workaround is to place ipsh() a priori at the different locations where you want the Python interpreter to launch an IPython shell...
Read more >
pdb — The Python Debugger — Python 3.11.1 documentation
The debugger prompt appears before any code is executed; you can set breakpoints and type continue , or you can step through the...
Read more >
5 Ways of Debugging with IPython - Sebastian Witowski
The only way to make debugging even more convenient is to automatically start a debugger if an exception is raised. And IPython has...
Read more >
Spyder - the Python IDE — Computational Science and Data ...
8.1 Line by line step execution of code. Activating the debug mode (Debug -> Debug) starts the IPython debugger (ipdb) in the IPython...
Read more >
PyDev Releases
... in debugger/console. Step in/step over support for IPython. ... Update debug console to work with newer versions of Eclipse (patch by Paul...
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