Jupyter kernel keeps dying with matplotlib

2,381 views
Skip to first unread message

Yidi Wu

unread,
Jun 23, 2018, 8:06:36 PM6/23/18
to Project Jupyter
Hi, I am a beginner with Python and are learning through the lectures "Quantitative Economics" at https://lectures.quantecon.org/py/python_by_example.html

I downloaded Anaconda and started Jupyter from there. My problem starts with one of the first examples in the lecture, where my Notebook's kernel keeps dying when the codes below are run (see screenshot 1):

But other basic stuff works fine. Even just defining "x" in this code also works (see screenshot 2). I am using a Mac, and have tried running Notebook on both Chrome and Brave browser.

Please help! Thank you!!

import numpy as np
import matplotlib.pyplot as plt

x = np.random.randn(100)
plt.plot(x)
plt.show()


1.png
2.png

Yidi Wu

unread,
Jun 23, 2018, 8:18:53 PM6/23/18
to Project Jupyter
Additionally, below is what my Terminal shows from launching Notebook to the error:

Last login: Sat Jun 23 20:14:15 on ttys000

YIDIs-MacBook-Air:~ yidiwu$ /Users/yidiwu/anaconda3/bin/jupyter_mac.command ; exit;

[I 20:16:40.316 NotebookApp] JupyterLab beta preview extension loaded from /Users/yidiwu/anaconda3/lib/python3.6/site-packages/jupyterlab

[I 20:16:40.316 NotebookApp] JupyterLab application directory is /Users/yidiwu/anaconda3/share/jupyter/lab

[I 20:16:40.342 NotebookApp] Serving notebooks from local directory: /Users/yidiwu

[I 20:16:40.343 NotebookApp] 0 active kernels

[I 20:16:40.343 NotebookApp] The Jupyter Notebook is running at:

[I 20:16:40.343 NotebookApp] http://localhost:8888/?token=59a75956a49954fde4d4fbf7971f849a2b68e98812e89dcd

[I 20:16:40.343 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).

[C 20:16:40.344 NotebookApp] 

    

    Copy/paste this URL into your browser when you connect for the first time,

    to login with a token:

        http://localhost:8888/?token=59a75956a49954fde4d4fbf7971f849a2b68e98812e89dcd&token=59a75956a49954fde4d4fbf7971f849a2b68e98812e89dcd

[I 20:16:40.921 NotebookApp] Accepting one-time-token-authenticated connection from ::1

[I 20:16:57.761 NotebookApp] Creating new notebook in /Desktop/Python

[I 20:17:00.356 NotebookApp] Kernel started: 5f22659b-4add-4b6c-b95c-701e3b4f548c

[I 20:17:04.695 NotebookApp] Adapting to protocol v5.1 for kernel 5f22659b-4add-4b6c-b95c-701e3b4f548c

Intel MKL FATAL ERROR: Cannot load libmkl_core.dylib.

[I 20:17:27.284 NotebookApp] KernelRestarter: restarting kernel (1/5), keep random ports

kernel 5f22659b-4add-4b6c-b95c-701e3b4f548c restarted

Jason Grout

unread,
Jun 24, 2018, 3:08:44 AM6/24/18
to jup...@googlegroups.com
This line indicates there is some problem with your Anaconda installation (i.e., nothing to do with Jupyter)

Intel MKL FATAL ERROR: Cannot load libmkl_core.dylib.

I would suggest these as options:

1. Contact anaconda support
2. possibly reinstall anaconda?
3. use the conda-forge package for numpy, which does not use the Intel MKL library that is printing the error above. You can install the conda-forge numpy by doing something like `conda install -c conda-forge numpy`, I think.

Jason


--
You received this message because you are subscribed to the Google Groups "Project Jupyter" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jupyter+u...@googlegroups.com.
To post to this group, send email to jup...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jupyter/24e80347-2cb8-48aa-81fc-bcf8c6a8f026%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Yidi Wu

unread,
Jun 24, 2018, 2:25:49 PM6/24/18
to jup...@googlegroups.com
Thank you! Reinstalling Anaconda did the trick!


For more options, visit https://groups.google.com/d/optout.
--
Yidi Wu
Reply all
Reply to author
Forward
0 new messages