spyder: Debug mode not working

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

any code, such as a = 1 # you can see the traceback follow, the spyder hanging at the first line of the code b = 1 c = a + b All operations (such as step F10, continue to next breakpoint F12) not responding when spyder in debug mode. it seems like the IDE is hanging, all I can do is click the “Stop the current command” to exit the debug mode, but afterwards I can not reenter debug mode or even simply run the code. i have to close spyder and open it again.

What steps reproduce the problem?

  1. debug any code and try to step inside

What is the expected output? What do you see instead?

the spyder can stop at the pre-setted break points, and can step the code

Paste Traceback/Error Below (if applicable)


Python 3.8.12 (default, Oct 12 2021, 03:01:40) [MSC v.1916 64 bit (AMD64)]
Type "copyright", "credits" or "license" for more information.

IPython 7.31.1 -- An enhanced Interactive Python.

debugfile('C:/Users/jandre/.spyder-py3/temp.py', wdir='C:/Users/jandre/.spyder-py3')
> c:\users\jandre\.spyder-py3\temp.py(2)<module>()
      1 # -*- coding: utf-8 -*-
----> 2 """
      3 Spyder Editor
      4 
      5 This is a temporary script file.

Versions

  • Spyder version: 5.1.5
  • Python version: 3.8.12
  • Qt version: 5.9.7
  • PyQt version: 5.9.2
  • Operating System name/version: Win 7

Dependencies

NO DEPENDENCIES

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 14
  • Comments: 41 (14 by maintainers)

Most upvoted comments

encountered the same issue. really freaks me out and kind of disappointed to the spyder. for linux user, no need to create a new virtual environment, just run conda install spyder=5.2.2 -c conda-forge then spyder5.1.5 will be automatically replaced by the newest version. now everything is fine. way to go spyder, still a big fan. just don’t be frightening like this next time lol.

Hi @McLowery, I’m not a Spyder dev but I’ll try to respond/help.

I have been using Anaconda Python for the past 8 years. It was a great disappointment that their spyder debugger stopped working.

This is a very general statement that I don’t agree with - at least for me the debugger is workin well. Moreover, the description of the problem you encounter does not suggest that the debugger is not working, only that you may be running Spyder in a different environment than the one where your numpy is installed.

You have installed Spyder in a conda environment named spyder-cf, but you seem to be updating your base environment trying to install numpy. As a result you seem to be updating many packages in your base environment to their conda-forge versions - this should be avoided (mixing packages from conda and conda-forge channels) as it can result in errors later on (binary incompatibilities etc.). To install numpy into the environment where spyder is installed you have to first activate that environment (conda activate spyder-cf) and only then try to install packages via conda install.

Thanks, @ccordoba12. I do not recall having installed numpy with pip, but there were some packages not available in anaconda, which I installed with pip. Did not cause any problems until now, but could be that this is the root for the problems now.

@ccordoba12 Yes that’s OK. I know what to do. Thank you all for the nice feedback and help!