Jupyter笔记本死亡内核

15

我试图修复我的Jupyter笔记本电脑(无法导入库),但是,似乎我让情况变得更糟了。现在每当我启动笔记本电脑时,内核会启动,然后立即死亡。 我得到的错误如下:

[I 15:00:39.002 NotebookApp] Serving notebooks from local directory: /Users/stephanng/Documents/Coding/IPyNB
[I 15:00:39.002 NotebookApp] 0 active kernels 
[I 15:00:39.003 NotebookApp] The Jupyter Notebook is running at: http://localhost:8888/
[I 15:00:39.003 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[W 15:00:43.558 NotebookApp] Notebook 157 Muon Analysis - Copy.ipynb is not trusted
[I 15:00:44.045 NotebookApp] Kernel started: 152a55a1-e393-4e86-b271-859b924e6a3e
/Users/stephanng/anaconda/envs/py27/bin/python: No module named _signatures; 'ipykernel' is a package and cannot be directly executed
[I 15:00:47.047 NotebookApp] KernelRestarter: restarting kernel (1/5)
/Users/stephanng/anaconda/envs/py27/bin/python: No module named _signatures; 'ipykernel' is a package and cannot be directly executed
[I 15:00:50.059 NotebookApp] KernelRestarter: restarting kernel (2/5)
/Users/stephanng/anaconda/envs/py27/bin/python: No module named _signatures; 'ipykernel' is a package and cannot be directly executed
[I 15:00:53.067 NotebookApp] KernelRestarter: restarting kernel (3/5)
/Users/stephanng/anaconda/envs/py27/bin/python: No module named _signatures; 'ipykernel' is a package and cannot be directly executed
[W 15:00:54.257 NotebookApp] Timeout waiting for kernel_info reply from 152a55a1-e393-4e86-b271-859b924e6a3e
[I 15:00:56.078 NotebookApp] KernelRestarter: restarting kernel (4/5)
WARNING:root:kernel 152a55a1-e393-4e86-b271-859b924e6a3e restarted
/Users/stephanng/anaconda/envs/py27/bin/python: No module named _signatures; 'ipykernel' is a package and cannot be directly executed
[W 15:00:59.094 NotebookApp] KernelRestarter: restart failed
[W 15:00:59.095 NotebookApp] Kernel 152a55a1-e393-4e86-b271-859b924e6a3e died, removing from map.
ERROR:root:kernel 152a55a1-e393-4e86-b271-859b924e6a3e restarted failed!
[W 15:00:59.116 NotebookApp] Kernel deleted before session
[W 15:00:59.117 NotebookApp] 410 DELETE /api/sessions/15eb80b6-d134-4142-96fa-1b1012be280c (::1) 5.42ms referer=http://localhost:8888/notebooks/157%20Muon%20Analysis%20-%20Copy.ipynb

有没有办法修复这个问题?还是我应该完全卸载并重新安装?另外,我该怎么做?当我运行sudo pip uninstall jupyter时,似乎没有起作用。


这是 pip uninstall jupyter-core jupyter-client notebook 的命令,但是除非你在虚拟环境中,否则还是一个不好的主意。 - OneCricketeer
你的笔记本电脑做了什么特殊处理吗?".ipynb不受信任"意味着它以某种方式进行了数字签名。 - OneCricketeer
2
我相信我已经让它正常工作了。我卸载了(基本上所有的东西),包括conda(通过rm -rf命令),然后重新安装了conda和jupyter。对于Python2笔记本,它似乎已经起作用了。 - Stephan Ng
1
我会删除内核并重新安装它。请参考这里 https://dev59.com/D1gQ5IYBdhLWcg3whEVn#42647666 - Yusuf
你尝试过这个吗 - pip install "ipython[notebook]" --upgrade - Reck
3个回答

1

0

激活conda环境后运行以下命令:

python -m ipykernel install --user


0

请在您的终端中尝试执行以下操作

pip install -U numpy


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接