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.

Spyder freeze after code execution

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

Spyder seems to freeze on IPython execution of any command for 10 seconds. That includes variable assignment (x = 10) and the import of libraries (import math as m). Scripts run fine but I still get the freeze after submitting the request. I have limited possiblities to look into the backend as this is at work in an environment provided at goodwill from our IT department and I can only access the program via a Citrix environment, one colleague however agreed to help me look into the issue. He can reproduce it on the VM the IDE runs on.

What steps reproduce the problem?

  1. Open Spyder (default setup)
  2. Execute any command in IPython
  3. Execution seems to succeed, then ten seconds of unresponsive state from the IDE in which nothing reacts.

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

I went and looked into a logfile of the above process(Opening spyder, executing x = 10, closing it again.

I suspect either kite or pyls as the problem driver, I found some issues regarding pyls, however these should have been fixed with the provided version (4.1.2). Looking into the section of the logfile where I execute a command, one can see the freeze:

2020-06-26 11:59:07,169 [DEBUG] [spyder.plugins.completion.languageserver.client] -> python response: textDocument/publishDiagnostics
2020-06-26 11:59:07,169 [DEBUG] [spyder.plugins.editor.plugin] -> python completion server request: 'textDocument/foldingRange'
2020-06-26 11:59:07,182 [DEBUG] [spyder.plugins.completion.languageserver.client] -> python request: textDocument/foldingRange
2020-06-26 11:59:07,182 [DEBUG] [spyder.plugins.completion.plugin] -> Completion plugin: Request 8 Got response from kite
2020-06-26 11:59:07,183 [DEBUG] [spyder.plugins.editor.plugin] -> python completion server request: 'textDocument/documentSymbol'
2020-06-26 11:59:07,183 [DEBUG] [spyder.plugins.completion.languageserver.client] -> python request: textDocument/documentSymbol
2020-06-26 11:59:07,183 [DEBUG] [spyder.plugins.completion.plugin] -> Completion plugin: Request 9 Got response from kite
2020-06-26 11:59:07,212 [DEBUG] [spyder.plugins.completion.plugin] -> Completion plugin: Request 8 Got response from lsp
2020-06-26 11:59:07,213 [DEBUG] [spyder.plugins.completion.plugin] -> Completion plugin: Request 8 removed
2020-06-26 11:59:07,213 [DEBUG] [spyder.plugins.completion.plugin] -> Gather responses for textDocument/foldingRange
2020-06-26 11:59:07,383 [DEBUG] [spyder.plugins.completion.plugin] -> Completion plugin: Request 9 timed out
2020-06-26 11:59:07,539 [DEBUG] [spyder.plugins.completion.plugin] -> Completion plugin: Request 9 Got response from lsp
2020-06-26 11:59:07,539 [DEBUG] [spyder.plugins.completion.plugin] -> Completion plugin: Request 9 removed
2020-06-26 11:59:07,539 [DEBUG] [spyder.plugins.completion.plugin] -> Gather responses for textDocument/documentSymbol
2020-06-26 11:59:10,282 [DEBUG] [traitlets] -> execute_input: {'code': 'x = 10', 'execution_count': 1}
2020-06-26 11:59:11,435 [DEBUG] [traitlets] -> execute_reply: {'status': 'ok', 'execution_count': 1, 'user_expressions': {}, 'payload': []}
2020-06-26 11:59:11,451 [DEBUG] [traitlets] -> handle_msg[9c1662d8b79311eab213005056be56e6]({'header': {'msg_id': 'f31622c4-94110c2fdea6112588bd9c3d_43', 'msg_type': 'comm_msg', 'username': 'username', 'session': 'f31622c4-94110c2fdea6112588bd9c3d', 'date': datetime.datetime(2020, 6, 26, 9, 59, 11, 451128, tzinfo=tzutc()), 'version': '5.3'}, 'msg_id': 'f31622c4-94110c2fdea6112588bd9c3d_43', 'msg_type': 'comm_msg', 'parent_header': {'msg_id': '8789e027-adccd8715cfcc768070580c9_16', 'msg_type': 'execute_request', 'username': 'username', 'session': '8789e027-adccd8715cfcc768070580c9', 'date': datetime.datetime(2020, 6, 26, 9, 59, 10, 282647, tzinfo=tzutc()), 'version': '5.3'}, 'metadata': {}, 'content': {'data': {'spyder_msg_type': 'remote_call_reply', 'content': {'is_error': False, 'call_id': '664c42e75e634dafbbf34cfd182477fd', 'call_name': 'get_namespace_view'}, 'pickle_protocol': 4, 'python_version': '3.7.7 (default, May  6 2020, 11:45:54) [MSC v.1916 64 bit (AMD64)]'}, 'comm_id': '9c1662d8b79311eab213005056be56e6'}, 'buffers': [<memory at 0x0000000AD3E32648>]})
2020-06-26 11:59:11,451 [DEBUG] [traitlets] -> handle_msg[9c1662d8b79311eab213005056be56e6]({'header': {'msg_id': 'f31622c4-94110c2fdea6112588bd9c3d_45', 'msg_type': 'comm_msg', 'username': 'username', 'session': 'f31622c4-94110c2fdea6112588bd9c3d', 'date': datetime.datetime(2020, 6, 26, 9, 59, 11, 451128, tzinfo=tzutc()), 'version': '5.3'}, 'msg_id': 'f31622c4-94110c2fdea6112588bd9c3d_45', 'msg_type': 'comm_msg', 'parent_header': {'msg_id': '8789e027-adccd8715cfcc768070580c9_19', 'msg_type': 'comm_msg', 'username': 'username', 'session': '8789e027-adccd8715cfcc768070580c9', 'date': datetime.datetime(2020, 6, 26, 9, 59, 11, 451128, tzinfo=tzutc()), 'version': '5.3'}, 'metadata': {}, 'content': {'data': {'spyder_msg_type': 'remote_call_reply', 'content': {'is_error': False, 'call_id': '4bf04aed8d1f4060b5e718bc5f5b2632', 'call_name': 'get_cwd'}, 'pickle_protocol': 4, 'python_version': '3.7.7 (default, May  6 2020, 11:45:54) [MSC v.1916 64 bit (AMD64)]'}, 'comm_id': '9c1662d8b79311eab213005056be56e6'}, 'buffers': [<memory at 0x0000000AD5A72D08>]})
2020-06-26 11:59:21,092 [DEBUG] [traitlets] -> handle_msg[9c1662d8b79311eab213005056be56e6]({'header': {'msg_id': 'f31622c4-94110c2fdea6112588bd9c3d_47', 'msg_type': 'comm_msg', 'username': 'username', 'session': 'f31622c4-94110c2fdea6112588bd9c3d', 'date': datetime.datetime(2020, 6, 26, 9, 59, 11, 451128, tzinfo=tzutc()), 'version': '5.3'}, 'msg_id': 'f31622c4-94110c2fdea6112588bd9c3d_47', 'msg_type': 'comm_msg', 'parent_header': {'msg_id': '8789e027-adccd8715cfcc768070580c9_19', 'msg_type': 'comm_msg', 'username': 'username', 'session': '8789e027-adccd8715cfcc768070580c9', 'date': datetime.datetime(2020, 6, 26, 9, 59, 11, 451128, tzinfo=tzutc()), 'version': '5.3'}, 'metadata': {}, 'content': {'data': {'spyder_msg_type': 'remote_call_reply', 'content': {'is_error': False, 'call_id': '8f74d8cbfc8345fa88cce17381fb1c72', 'call_name': 'get_var_properties'}, 'pickle_protocol': 4, 'python_version': '3.7.7 (default, May  6 2020, 11:45:54) [MSC v.1916 64 bit (AMD64)]'}, 'comm_id': '9c1662d8b79311eab213005056be56e6'}, 'buffers': [<memory at 0x0000000AD5A727C8>]})
2020-06-26 11:59:21,233 [DEBUG] [spyder.plugins.editor.plugin] -> python completion server request: 'textDocument/cursorEvent'
2020-06-26 11:59:21,238 [DEBUG] [spyder.plugins.completion.plugin] -> Completion plugin: Request 10 Got response from kite
2020-06-26 11:59:21,433 [DEBUG] [spyder.plugins.completion.plugin] -> Completion plugin: Request 10 timed out

Execution happens at 11:59:10, short response at 11:59:11, then the IDE freezes and only reacts after 11:59:21. Is the last line significant here?

Versions

  • Spyder version: 4.1.2
  • Python version: 3.7.7
  • Qt version: Qt 5.12.5
  • PyQt version: PyQt5 5.12.3
  • Operating System name/version: Windows 2012ServerR2

Dependencies


# Mandatory:
atomicwrites >=1.2.0           :  1.4.0 (OK)
chardet >=2.0.0                :  3.0.4 (OK)
cloudpickle >=0.5.0            :  1.4.1 (OK)
diff_match_patch >=20181111    :  20181111 (OK)
intervaltree                   :  None (OK)
IPython >=4.0                  :  7.15.0 (OK)
jedi =0.15.2                   :  0.15.2 (OK)
nbconvert >=4.0                :  5.6.1 (OK)
numpydoc >=0.6.0               :  1.0.0 (OK)
paramiko >=2.4.0               :  2.7.1 (OK)
parso =0.5.2                   :  0.5.2 (OK)
pexpect >=4.4.0                :  4.8.0 (OK)
pickleshare >=0.4              :  0.7.5 (OK)
psutil >=5.3                   :  5.7.0 (OK)
pygments >=2.0                 :  2.6.1 (OK)
pylint >=0.25                  :  2.4.4 (OK)
pyls >=0.31.9;<0.32.0          :  0.31.10 (OK)
qdarkstyle >=2.8               :  2.8.1 (OK)
qtawesome >=0.5.7              :  0.7.2 (OK)
qtconsole >=4.6.0              :  4.7.4 (OK)
qtpy >=1.5.0                   :  1.9.0 (OK)
rtree >=0.8.3                  :  0.9.4 (OK)
sphinx >=0.6.6                 :  3.0.4 (OK)
spyder_kernels >=1.9.1;<1.10.0 :  1.9.1 (OK)
watchdog                       :  None (OK)
zmq >=17                       :  18.1.1 (OK)

# Optional:
cython >=0.21                  :  0.29.20 (OK)
matplotlib >=2.0.0             :  3.2.1 (OK)
numpy >=1.7                    :  1.18.1 (OK)
pandas >=0.13.1                :  1.0.4 (OK)
scipy >=0.17.0                 :  1.4.1 (OK)
sympy >=0.7.3                  :  1.6 (OK)

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:20 (14 by maintainers)

github_iconTop GitHub Comments

1reaction
CAM-Gerlachcommented, Jul 18, 2020

Just to clarify as well, by “work being done” I meant by community contributors and not the core Spyder team. Funding it is an option (and would probably not involve too much of an outlay, especially compared to the benefit for your specific case), and so is contributing the feature yourself; as you presumably are relatively experienced with Python it shouldn’t be too difficult following the examples given in the linked issues/PRs, if you’re so inclined. Thanks!

0reactions
ccordoba12commented, Oct 28, 2020

Closing because this is not caused by Spyder but by an external program and we don’t have control over it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Spyder IDE randomly freezes - python - Stack Overflow
It freezes while I'm trying to open a file, save a file, change preferences, and while looking at a code analysis error. I...
Read more >
Spyder hangs while running script, persists after re-installation
1 Answer 1 ... Try disabling "user module reloading" under python interpeter in preferences. It seems to hang on that for me. ......
Read more >
Common Illnesses — Spyder 5 documentation
If you receive the message An error occurred while starting the kernel in the IPython Console, Spyder was unable to launch a new...
Read more >
spyder-ide/public - Gitter
Hi! I am using Spyder 3.3.6 with Python3.7 on Windows 10. After it worked perfectly for several weeks Spyder freezes randomly when I'm...
Read more >
Spyder (python 3.9) experiencing an error every time I run a ...
I'm new to python and for the second day following an MIT course, when I use the following codes from the example py...
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