Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Kernel appears to have died - Jupyter notebook python matplotlib

I am trying to learn charting in Python and keep getting this message in Jupyter:

The kernel appears to have died. It will restart automatically.

My other basic programs are working, so it looks like using Matplotlib is causing this problem. Any thoughts on how to resolve this?

import matplotlib.pyplot as plt

plt.plot()
plt.show()

Screenshot of message I am getting

like image 775
ps1495 Avatar asked Feb 20 '26 04:02

ps1495


2 Answers

if you don't solve the problem after using method above, you can try this:

import os    
os.environ['KMP_DUPLICATE_LIB_OK'] = 'True'

add two lines of codes in your python code. This mothed is also useful to pycharm.

like image 174
yinghaodang Avatar answered Feb 21 '26 17:02

yinghaodang


If the libiomp5md.dll file is not in the binary exectuables folder of your environment, then this may be the cause of the kernel dying.

  1. Download the libiomp5md.dll file from a trusted online source. I used https://www.dll-files.com/libiomp5md.dll.html and downloaded the latest version. I do not condone the use of this link, and please do your own research to find a trusted source to download this file.

  2. Navigate to -> ./anaconda3/envs/your_env_name/Library/bin and add the libiomp5md.dll file to that folder.

  3. matplotlib should now work without kernel dying, as it did for me.

like image 38
Andrew Carlson Avatar answered Feb 21 '26 18:02

Andrew Carlson



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!