Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/340.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python Jupyter笔记本内核在尝试运行matplotlib时死机_Python_Matplotlib_Jupyter Notebook - Fatal编程技术网

Python Jupyter笔记本内核在尝试运行matplotlib时死机

Python Jupyter笔记本内核在尝试运行matplotlib时死机,python,matplotlib,jupyter-notebook,Python,Matplotlib,Jupyter Notebook,一般来说,我对Python和编程非常陌生。我试图在Jupyter笔记本中使用matplotlib绘制一个简单的图形,但错误消息不断弹出,说内核已经死了。我试过重新安装水蟒和朱皮特。我也尝试过“conda install nomkl”,但问题仍然存在。下面是一些屏幕截图 这是我的终端窗口的副本: [I 15:01:58.001 NotebookApp] JupyterLab extension loaded from /Applications/anaconda3/lib/python3.7/

一般来说,我对Python和编程非常陌生。我试图在Jupyter笔记本中使用matplotlib绘制一个简单的图形,但错误消息不断弹出,说内核已经死了。我试过重新安装水蟒和朱皮特。我也尝试过“conda install nomkl”,但问题仍然存在。下面是一些屏幕截图

这是我的终端窗口的副本:

[I 15:01:58.001 NotebookApp] JupyterLab extension loaded from 
/Applications/anaconda3/lib/python3.7/site-packages/jupyterlab
[I 15:01:58.002 NotebookApp] JupyterLab application directory is 
/Applications/anaconda3/share/jupyter/lab
[I 15:01:58.012 NotebookApp] Serving notebooks from local directory: /Users/ScottJohnson
[I 15:01:58.013 NotebookApp] The Jupyter Notebook is running at:
[I 15:01:58.013 NotebookApp] http://localhost:8888/? 
token=68e1eadc99bad8ce436618fa11bf3b585bd49aaeab6a6e99
[I 15:01:58.013 NotebookApp]  or http://127.0.0.1:8888/? 
token=68e1eadc99bad8ce436618fa11bf3b585bd49aaeab6a6e99
[I 15:01:58.014 NotebookApp] Use Control-C to stop this server and shut down all kernels 
(twice to skip confirmation).
[C 15:01:58.032 NotebookApp] 

    To access the notebook, open this file in a browser:
        file:///Users/ScottJohnson/Library/Jupyter/runtime/nbserver-3489-open.html
    Or copy and paste one of these URLs:
        http://localhost:8888/?token=68e1eadc99bad8ce436618fa11bf3b585bd49aaeab6a6e99
    or http://127.0.0.1:8888/?token=68e1eadc99bad8ce436618fa11bf3b585bd49aaeab6a6e99
[W 15:02:22.969 NotebookApp] Notebook Desktop/Python Class/CourseMaterial/06 - 
Functions/0615 - Birth statistics graphic.ipynb is not trusted
[I 15:02:23.728 NotebookApp] Kernel started: 0d91235f-3ea8-46a2-ade3-ca33b2bd1049
[I 15:02:47.683 NotebookApp] KernelRestarter: restarting kernel (1/5), keep random ports
kernel 0d91235f-3ea8-46a2-ade3-ca33b2bd1049 restarted
[I 15:02:59.703 NotebookApp] KernelRestarter: restarting kernel (1/5), keep random ports
kernel 0d91235f-3ea8-46a2-ade3-ca33b2bd1049 restarted
[I 15:04:33.401 NotebookApp] Saving file at /Desktop/Python Class/CourseMaterial/06 - 
Functions/0615 - Birth statistics graphic.ipynb
[I 15:06:23.399 NotebookApp] Saving file at /Desktop/Python Class/CourseMaterial/06 - 
Functions/0615 - Birth statistics graphic.ipynb
[I 15:08:24.103 NotebookApp] Saving file at /Desktop/Python Class/CourseMaterial/06 - 
Functions/0615 - Birth statistics graphic.ipynb
[I 15:09:08.714 NotebookApp] KernelRestarter: restarting kernel (1/5), keep random ports
kernel 0d91235f-3ea8-46a2-ade3-ca33b2bd1049 restarted
[I 15:10:23.359 NotebookApp] Saving file at /Desktop/Python Class/CourseMaterial/06 - 
Functions/0615 - Birth statistics graphic.ipynb

首先尝试执行matplotlib导入。通常,当您遇到这样的错误时,请逐行执行代码,看看是哪一行导致了错误。从您的屏幕截图中,我们无法判断问题是由导入还是打印引起的,因为两者位于同一个笔记本单元中。顺便说一句,您不需要在笔记本中使用
plt.show()
。我尝试只运行导入,内核可能是硬件问题?您可以尝试在不使用笔记本的情况下从shell运行matplotlib导入行吗?首先尝试执行matplotlib导入。通常,当您遇到这样的错误时,请逐行执行代码,以查看哪一行导致错误。从您的屏幕截图中,我们无法判断问题是由导入还是打印引起的,因为两者位于同一个笔记本单元中。顺便说一句,您不需要在笔记本中使用
plt.show()
。我尝试只运行导入,内核可能是硬件问题?您可以尝试在不使用笔记本的情况下从shell运行matplotlib导入行吗?