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.

Interactive plot windows freeze

See original GitHub issue

Hi,

when a matplotlib plot window opens (using the Gt5 backend), the plot window freezes after my first interaction with it. For example, I click on “save”, the save-file-manager opens, but then it instantly closes again and the plot window is frozen.

It does not happen when I run the script in a normal terminal. There, the interactive plot window works just fine, so I figured it must be Spyder related.

Spyder 5.2.2 Python 3.7.15 64-bit IPython 7.31.1 Qt 5.15.2 PyQt5 5.15.7 Linux 5.4.0-131-generic Matplotlib 3.5.3

System: Ubuntu 18.04.5

What steps reproduce the problem?

Open Spyder, run

import matplotlib.pyplot as plt

fig, axs = plt.subplots()

Paste Traceback/Error Below (if applicable)

No error message.

Dependencies

# Mandatory:
atomicwrites >=1.2.0          :  1.4.0 (OK)
chardet >=2.0.0               :  4.0.0 (OK)
cloudpickle >=0.5.0           :  2.0.0 (OK)
cookiecutter >=1.6.0          :  1.7.3 (OK)
diff_match_patch >=20181111   :  20200713 (OK)
intervaltree >=3.0.2          :  3.1.0 (OK)
IPython >=7.6.0;<8.0.0        :  7.31.1 (OK)
jedi >=0.17.2;<0.19.0         :  0.18.1 (OK)
jellyfish >=0.7               :  0.9.0 (OK)
jsonschema >=3.2.0            :  4.16.0 (OK)
keyring >=17.0.0              :  23.4.0 (OK)
nbconvert >=4.0               :  6.4.4 (OK)
numpydoc >=0.6.0              :  1.5.0 (OK)
parso >=0.7.0;<0.9.0          :  0.8.3 (OK)
pexpect >=4.4.0               :  4.8.0 (OK)
pickleshare >=0.4             :  0.7.5 (OK)
psutil >=5.3                  :  5.9.0 (OK)
pygments >=2.0                :  2.11.2 (OK)
pylint >=2.5.0                :  2.14.5 (OK)
pyls_spyder >=0.4.0           :  0.4.0 (OK)
pylsp >=1.3.2;<1.4.0          :  1.3.3 (OK)
pylsp_black >=1.0.0           :  1.0.0 (OK)
qdarkstyle =3.0.2             :  3.0.2 (OK)
qstylizer >=0.1.10            :  0.1.10 (OK)
qtawesome >=1.0.2             :  1.0.3 (OK)
qtconsole >=5.2.1;<5.3.0      :  5.2.2 (OK)
qtpy >=1.5.0                  :  2.2.0 (OK)
rtree >=0.9.7                 :  0.9.7 (OK)
setuptools >=49.6.0           :  65.5.0 (OK)
sphinx >=0.6.6                :  5.0.2 (OK)
spyder_kernels >=2.2.1;<2.3.0 :  2.2.1 (OK)
textdistance >=4.2.0          :  4.2.1 (OK)
three_merge >=0.1.1           :  0.1.1 (OK)
watchdog >=0.10.3             :  2.1.6 (OK)
xdg >=0.26                    :  0.27 (OK)
zmq >=17                      :  23.2.0 (OK)

# Optional:
cython >=0.21                 :  None (NOK)
matplotlib >=2.0.0            :  3.5.3 (OK)
numpy >=1.7                   :  1.21.5 (OK)
pandas >=1.1.1                :  1.3.5 (OK)
scipy >=0.17.0                :  1.7.3 (OK)
sympy >=0.7.3                 :  None (NOK)

Issue Analytics

  • State:closed
  • Created 10 months ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
SchroedingersLioncommented, Nov 14, 2022

Thank you for the new info @ReneLoh ! I would suggest for testing proposes to create a new conda environment with packages from the conda-forge channel (so you can try the latest Spyder version). For that you can do something like the following from a terminal (the env will need to be created with at least Python 3.8):

conda create -n spyder-cf -c conda-forge python=3.8 spyder=5.4.0 matplotlib
conda activate spyder-cf
spyder

Let us know if the issue persists using the latest Spyder release

@dalthviz Thank you, @dalthviz! Executing the recommended commands and launching Spyder 5.4.0 in the new environment fixed the issue! The interactive plot windows works as it should.

So, would you recommend me to do all Spyder-work in this new environment and load all packages from conda-forge?

1reaction
SchroedingersLioncommented, Nov 15, 2022

Thank you for the help and the tips!!

Read more comments on GitHub >

github_iconTop Results From Across the Web

VSCode Python interactive window freezes when using ...
I often develop interactively (Shift-Enter) with an interactive Jupyter Window, often including matplotlib and I want the windows externally ...
Read more >
matplotlib figures get frozen when executed from ipython ...
suddenly, executing any matplotlib plotting commands leads to the canvas window becoming frozen as in the attached picture.
Read more >
IDLE python shell freezes after running show() of matplotlib
I am having a weird problem on IDLE. After I plot something using show () of matplotlib, the python shell prompt in IDLE...
Read more >
AutoCAD freezes before displaying the plot window
Solution: Remove plotter saved in the drawings by doing the following: Launch AutoCAD. Go to Application Menu > DWG Convert.
Read more >
Interactive figures and asynchronous programming - Matplotlib
Matplotlib supports rich interactive figures by embedding figures into a GUI window. The basic interactions of panning and zooming in an Axes to...
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