After using Spyder for some period of time, while typing in the editor Spyder suddenly becomes unresponsive and the cursor becomes the spinning beachball of death. The only way to proceed is to force quit Spyder (Activity Monitor confirms that the Python process is unresponsive).
FYI: I run Spyder from a dedicated Anaconda environment created by
>> conda create -n spyder-beta -c spyder-ide spyder
I am uncertain what actions will reproduce the problem, other than to use Spyder for some period of time.
pygments >=2.0 : 2.4.2 (OK)
qdarkstyle >=2.6.4: 2.7 (OK)
sphinx >=0.6.6 : 2.1.2 (OK)
psutil >=0.3 : 5.6.3 (OK)
pyls >=0.27.0 : 0.28.0 (OK)
nbconvert >=4.0 : 5.5.0 (OK)
pandas >=0.13.1 : None (NOK)
numpy >=1.7 : None (NOK)
sympy >=0.7.3 : None (NOK)
cython >=0.21 : None (NOK)
qtconsole >=4.5.2 : 4.5.2 (OK)
IPython >=4.0 : 7.7.0 (OK)
matplotlib >=2.0.0: None (NOK)
pylint >=0.25 : 2.3.1 (OK)
This is very vague, so I'm afraid we can't do anything about it unless you narrow down the circumstances a bit more.
You can also start Spyder in debug mode with:
spyder --debug-info verbose --debug-output file
then upload here the file called spyder-debug.log
, present in the directory where you started Spyder.
@ccordoba12, thanks for responding. Yes, it is vague, unfortunately. My plan was to do just as you suggested and create a debug log file. I found another post mentioning "SPYDER_DEBUG=3", so I set that environment variable and redirected output to a log file.
>> export SPYDER_DEBUG=3
>> spyder >& file
Is there a difference between this and --debug-info verbose
?
Is there a difference between this and --debug-info verbose?
Nop, it's just more user friendly.
Excellent. I'll post here as soon as I have something more substantive.
I seem to be having the same issue, and suspect that it may be related to the autocompletion functions. On several occasions Spyder froze when pressing tab to complete a function or variable name.
Okay, I can't say exactly how I froze spyder before other than it occurred while I was typing in the editor. However, I have been able to freeze spyder reproducibly by using the keyboard shortcut opt-shift-cmd-. (editor: next warning) in a file that does not have any warnings. Attached is the debug log file. Following are the steps to reproduce the issue with the log file line numbers generated during the process.
@mrclary I can confirm this. Will issue a fix (at least for that!)
@goanpeca , thanks. Any idea what this is related to? I imagine that the keyboard shortcut is related to the original reason I filed this issue. I believe that I was just lucky to stumble across it as this keyboard shortcut is not one that have used in the past.
The code is going into a while
loop with no breaking condition under these circumstances.
while True:
if block.blockNumber()+1 < line_count:
block = block.next()
else:
block = self.document().firstBlock()
data = block.userData()
if data and data.code_analysis:
break
@mrclary I think this bug is similar but may not be exactly what you found. Now since the symptoms are similar, @ccordoba12 I think we need to audit all the code inside codeeditor.py
where we are using a while
loop. We are most likely missing breaking conditions.
I think we need to audit all the code inside codeeditor.py where we are using a while loop
I agree. That's the danger of using a while
to do iterations.
@mrclary, we discovered why this is happening. We're tracing the problem on issue #10209.
I have the same problem. Spyder is often hanging when I am writing code, - I suspect it happens if I am typing too quickly. Maybe because the automatic syntax checking is not hanging on fast enough.
I've had multiple freezes during past four weeks when typing in the Spyder editor . If I am working in Spyder longer than 1 hour it is almost guaranteed that I get a freeze. When I work in Spyder for multiple hours I usually have at least one freeze every 1-2 hours (I restart Spyder). My hunch is that it is related to code completions running in Spyder - I often got the freezes when a completion box was open/opening. Unfortunatelly it is hard to narrow this down as it happens approximately once an hour without very clear pattern.
Most helpful comment
I've had multiple freezes during past four weeks when typing in the Spyder editor . If I am working in Spyder longer than 1 hour it is almost guaranteed that I get a freeze. When I work in Spyder for multiple hours I usually have at least one freeze every 1-2 hours (I restart Spyder). My hunch is that it is related to code completions running in Spyder - I often got the freezes when a completion box was open/opening. Unfortunatelly it is hard to narrow this down as it happens approximately once an hour without very clear pattern.