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.

"Kernel died, restarting" when using matplotlib.pyplot

See original GitHub issue

Description of your problem

IPython console dies after using matplotlib.pyplot

What steps will reproduce the problem?

  1. Using matplotlib.pyplot in any way. E.g. after import matplotlib.pyplot as plt, using fig=plt.figure(1,figsize=(5,2),dpi=120) or cs=m.contourf(x,y,Z[:],cmap=plt.get_cmap('gist_earth'))

What is the expected output? What do you see instead? IPython console shows “Kernel died, restarting” and all variables are cleared.

Please provide any additional information below Not sure if this has something to do with this error, but I noticed that sometimes (not always) when I run spyder from the terminal, as soon as it opens IPython console gives the same message (“Kernel died, restarting”) and terminal shows this error: (python:2992): Gtk-CRITICAL **: IA__gtk_widget_get_direction: assertion 'GTK_IS_WIDGET (widget)' failed.

Versions and main components

  • Spyder Version: 3.1.2
  • Python Version: 3.4.5
  • Qt Version: 4.8.7
  • PyQt Version: PyQt4 (API v2) 4.11.4 on Linux
  • Operating system: Linux Mint 17.2 32 bits

Dependencies

jedi >=0.8.1 : 0.9.0 (OK) matplotlib >=1.0 : 1.5.1 (OK) nbconvert >=4.0 : 4.2.0 (OK) numpy >=1.7 : 1.10.2 (OK) pandas >=0.13.1 : 0.18.1 (OK) pep8 >=0.6 : 1.7.0 (OK) psutil >=0.3 : 5.0.1 (OK) pyflakes >=0.6.0 : 1.5.0 (OK) pygments >=2.0 : 2.1.3 (OK) pylint >=0.25 : 1.6.4 (OK) qtconsole >=4.2.0: 4.2.1 (OK) rope >=0.9.4 : 0.9.4-1 (OK) sphinx >=0.6.6 : 1.5.1 (OK) sympy >=0.7.3 : 1.0 (OK)

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
k-zhaicommented, Dec 7, 2020

I also have this issue. By the way, you don’t just close this issue if you don’t a solution. You leave it open in case someone else has a solution.

0reactions
Ranjan-Rajucommented, Aug 15, 2018

I have the same issue

Read more comments on GitHub >

github_iconTop Results From Across the Web

Kernel dies when trying to plot an image with matplotlib #6219
Describe the bug Kernel dies when running plt.plot([0,1], [0,1]) To Reproduce run this code import matplotlib.pyplot as plt plt.plot([0,1], ...
Read more >
Kernel appears to have died - Jupyter notebook python ...
The kernel appears to have died. It will restart automatically. My other basic programs are working, so it looks like using Matplotlib is ......
Read more >
The kernel appears to have died. It will restart automatically ...
The kernel appears to have died. It will restart automatically. [ MATPLOTLIB ]. 23K views 1 year ago.
Read more >
Kernel Dying in Jupyter Notebook with Matplotlib - Reddit
"The kernel appears to have died. It will restart automatically." After putting this message into a Google I was taken to stackoverflow, where ......
Read more >
Jupyter kernel keeps dying with matplotlib - Google Groups
Hi, I am a beginner with Python and are learning through the ... where my Notebook's kernel keeps dying when the codes below...
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