python - 无法运行 jupyter notebook//NotImplementedError

标签 python windows pip jupyter-notebook jupyter

<分区>

尝试在本地主机上构建 jupyter notebook,出现错误,

我使用 Windows 10,更新了 Microsoft Visual C++ 到 14 版本

尝试过 pip 卸载 pyzmq

pip 卸载 jsonschema

pip 安装 pyzmq

pip 安装 jsonschema

但总是这个错误

Traceback (most recent call last):
  File "c:\users\axon\appdata\local\programs\python\python38\lib\runpy.py", line 192, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "c:\users\axon\appdata\local\programs\python\python38\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "C:\Users\axon\AppData\Local\Programs\Python\Python38\Scripts\jupyter-notebook.EXE\__main__.py", line 7, in <module>
  File "c:\users\axon\appdata\local\programs\python\python38\lib\site-packages\jupyter_core\application.py", line 268, in launch_instance
    return super(JupyterApp, cls).launch_instance(argv=argv, **kwargs)
  File "c:\users\axon\appdata\local\programs\python\python38\lib\site-packages\traitlets\config\application.py", line 663, in launch_instance
    app.initialize(argv)
  File "<c:\users\axon\appdata\local\programs\python\python38\lib\site-packages\decorator.py:decorator-gen-7>", line 2, in initialize
  File "c:\users\axon\appdata\local\programs\python\python38\lib\site-packages\traitlets\config\application.py", line 87, in catch_config_error
    return method(app, *args, **kwargs)
  File "c:\users\axon\appdata\local\programs\python\python38\lib\site-packages\notebook\notebookapp.py", line 1679, in initialize
    self.init_webapp()
  File "c:\users\axon\appdata\local\programs\python\python38\lib\site-packages\notebook\notebookapp.py", line 1442, in init_webapp
    self.http_server.listen(port, self.ip)
  File "c:\users\axon\appdata\local\programs\python\python38\lib\site-packages\tornado\tcpserver.py", line 152, in listen
    self.add_sockets(sockets)
  File "c:\users\axon\appdata\local\programs\python\python38\lib\site-packages\tornado\tcpserver.py", line 165, in add_sockets
    self._handlers[sock.fileno()] = add_accept_handler(
  File "c:\users\axon\appdata\local\programs\python\python38\lib\site-packages\tornado\netutil.py", line 279, in add_accept_handler
    io_loop.add_handler(sock, accept_handler, IOLoop.READ)
  File "c:\users\axon\appdata\local\programs\python\python38\lib\site-packages\tornado\platform\asyncio.py", line 99, in add_handler
    self.asyncio_loop.add_reader(fd, self._handle_events, fd, IOLoop.READ)
  File "c:\users\axon\appdata\local\programs\python\python38\lib\asyncio\events.py", line 501, in add_reader
    raise NotImplementedError
NotImplementedError

最佳答案

  1. 打开文件 ...\tornado\platform\asyncio.py
    (错误消息中引用的倒数第二个文件)

  2. 在“import asyncio”之后的代码中添加以下几行:

    import sys
    if sys.platform == 'win32':
        asyncio.set_event_loop_policy (asyncio.WindowsSelectorEventLoopPolicy())
    

    并保存文件。

  3. 查看图像: enter image description here

  4. 现在只需输入命令jupyter lab

关于python - 无法运行 jupyter notebook//NotImplementedError,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58556874/

相关文章:

C++ 读取和编辑位图图像的像素

Python PIP 和不安全平台警告

python - Gunicorn 没有使用正确的设置文件 Django?

python - 使用 Python 中的 index() 以外的方法将字符串中的第二个字母设为大写?

c - C上的系统编程

windows - C(++) 编译器转换 - 请让 DJGPP 消失

python - 使 python 模块可用作 cli 工具的最简单方法

python - 如何在使用 pip 安装的 Anaconda 中卸载软件包

python - 无法从网页中提取连接到 `see all` 按钮的链接

python - ipython 内核在 16gb 的 linux 盒子中最大容量为 3gb?