0

因为我开始使用 ubuntu 20.04 LTE,所以我想安装 jupyter notebook 及其控制台。我安装了点子:

sudo apt install python3-pip

因此,我安装了:

pip3 install jupyter

pip3 install notebook

我无法执行任何这些命令来让笔记本或控制台运行。

我发现在我的路径~/.local/bin/中存储了所有这些 python 脚本。从那里我可以运行笔记本和控制台。但是控制台无法执行。它总是抱怨有一些模块丢失或不在路径中。

In [1]: 2+2/home/NAME/.local/lib/python3.8/site-packages/jupyter_console/ptshell.py:852: RuntimeWarning: coroutine 'ZMQSocketChannel.msg_ready' was never awaited
  while self.client.iopub_channel.msg_ready():
RuntimeWarning: Enable tracemalloc to get the object allocation traceback

Unhandled exception in event loop:
  File "/usr/lib/python3.8/asyncio/events.py", line 81, in _run
    self._context.run(self._callback, *self._args)
  File "/home/NAME/.local/lib/python3.8/site-packages/prompt_toolkit/input/vt100.py", line 170, in callback_wrapper
    callback()
  File "/home/NAME/.local/lib/python3.8/site-packages/prompt_toolkit/application/application.py", line 690, in read_from_input
    self.key_processor.process_keys()
  File "/home/NAME/.local/lib/python3.8/site-packages/prompt_toolkit/key_binding/key_processor.py", line 271, in process_keys
    self._process_coroutine.send(key_press)
  File "/home/NAME/.local/lib/python3.8/site-packages/prompt_toolkit/key_binding/key_processor.py", line 186, in _process
    self._call_handler(matches[-1], key_sequence=buffer[:])
  File "/home/NAME/.local/lib/python3.8/site-packages/prompt_toolkit/key_binding/key_processor.py", line 321, in _call_handler
    handler.call(event)
  File "/home/NAME/.local/lib/python3.8/site-packages/prompt_toolkit/key_binding/key_bindings.py", line 124, in call
    result = self.handler(event)
  File "/home/NAME/.local/lib/python3.8/site-packages/jupyter_console/ptshell.py", line 475, in _
    self.handle_iopub()
  File "/home/NAME/.local/lib/python3.8/site-packages/jupyter_console/ptshell.py", line 854, in handle_iopub
    msg_type = sub_msg['header']['msg_type']

Exception 'coroutine' object is not subscriptable
Press ENTER to continue...

pip3 也存储在此路径中。我的意思是不应该是这样的/usr/lib/python3/dist-packages/...。我不知道我第一次使用 ubuntu 时是怎么搞砸的。

很抱歉我的描述不清楚,因为 3 小时我试图解决这个问题,但我不再记得每一步了。有人可以帮忙吗?谢谢。

4

0 回答 0