我已经在pi的全新debian安装中安装了Jupyter笔记本。我在以前的安装中能完美地工作。我不明白为什么该安装无法正常工作。内核无法启动。
@raspberrypi:~ $ jupyter notebook
[I 14:14:54.030 NotebookApp] Serving notebooks from local directory: /home/pi
[I 14:14:54.031 NotebookApp] The Jupyter Notebook is running at:
[I 14:14:54.031 NotebookApp] http://localhost:8888/?token=3d0f751a532a4e1a3744a1a49701fbde9a17d1d95fda43ca
[I 14:14:54.032 NotebookApp] or http://127.0.0.1:8888/?token=3d0f751a532a4e1a3744a1a49701fbde9a17d1d95fda43ca
[I 14:14:54.033 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[C 14:14:54.249 NotebookApp]
To access the notebook, open this file in a browser:
file:///home/pi/.local/share/jupyter/runtime/nbserver-837-open.html
Or copy and paste one of these URLs:
http://localhost:8888/?token=3d0f751a532a4e1a3744a1a49701fbde9a17d1d95fda43ca
or http://127.0.0.1:8888/?token=3d0f751a532a4e1a3744a1a49701fbde9a17d1d95fda43ca
[I 14:15:26.196 NotebookApp] Kernel started: 9c892a78-7ef2-4d36-9649-d46392e26bb7
Traceback (most recent call last):
File "/usr/lib/python3.7/runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "/usr/lib/python3.7/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/usr/lib/python3/dist-packages/ipykernel_launcher.py", line 15, in <module>
from ipykernel import kernelapp as app
File "/usr/lib/python3/dist-packages/ipykernel/__init__.py", line 2, in <module>
from .connect import *
File "/usr/lib/python3/dist-packages/ipykernel/connect.py", line 13, in <module>
from IPython.core.profiledir import ProfileDir
File "/usr/lib/python3/dist-packages/IPython/__init__.py", line 49, in <module>
from .terminal.embed import embed
File "/usr/lib/python3/dist-packages/IPython/terminal/embed.py", line 18, in <module>
from IPython.terminal.interactiveshell import TerminalInteractiveShell
File "/usr/lib/python3/dist-packages/IPython/terminal/interactiveshell.py", line 20, in <module>
from prompt_toolkit.shortcuts import create_prompt_application, create_eventloop, create_prompt_layout, create_output
ImportError: cannot import name 'create_prompt_application' from 'prompt_toolkit.shortcuts' (/usr/local/lib/python3.7/dist-packages/prompt_toolkit/shortcuts/__init__.py)
[I 14:15:32.162 NotebookApp] KernelRestarter: restarting kernel (1/5), keep random ports
Traceback (most recent call last):
File "/usr/lib/python3.7/runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "/usr/lib/python3.7/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/usr/lib/python3/dist-packages/ipykernel_launcher.py", line 15, in <module>
from ipykernel import kernelapp as app
File "/usr/lib/python3/dist-packages/ipykernel/__init__.py", line 2, in <module>
from .connect import *
File "/usr/lib/python3/dist-packages/ipykernel/connect.py", line 13, in <module>
from IPython.core.profiledir import ProfileDir
File "/usr/lib/python3/dist-packages/IPython/__init__.py", line 49, in <module>
from .terminal.embed import embed
File "/usr/lib/python3/dist-packages/IPython/terminal/embed.py", line 18, in <module>
from IPython.terminal.interactiveshell import TerminalInteractiveShell
File "/usr/lib/python3/dist-packages/IPython/terminal/interactiveshell.py", line 20, in <module>
from prompt_toolkit.shortcuts import create_prompt_application, create_eventloop, create_prompt_layout, create_output
ImportError: cannot import name 'create_prompt_application' from 'prompt_toolkit.shortcuts' (/usr/local/lib/python3.7/dist-packages/prompt_toolkit/shortcuts/__init__.py)
[I 14:15:35.190 NotebookApp] KernelRestarter: restarting kernel (2/5), keep random ports
$
有人能照亮我的情况吗?
答案 0 :(得分:0)
使用以下cmd将〜/ .local / share / jupyter目录的所有权从根目录更改为pi:
sudo chown -R pi:pi ~/.local/share/jupyter