具有Python 3.8的Jupyter Notebook-NotImplementedError [英] Jupyter Notebook with Python 3.8 - NotImplementedError

查看:290
本文介绍了具有Python 3.8的Jupyter Notebook-NotImplementedError的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

最近升级到Python 3.8,并安装了jupyter.但是,当尝试运行jupyter notebook时,出现以下错误:

Upgraded recently to Python 3.8, and installed jupyter. However, when trying to run jupyter notebook getting the following error:

  File "c:\users\user\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\user\appdata\local\programs\python\python38\lib\asyncio\events.py", line 501, in add_reader
    raise NotImplementedError
NotImplementedError

我知道Windows上的Python 3.8默认情况下已切换为ProactorEventLoop,因此我怀疑它与此相关.

I know Python 3.8 on windows switched to ProactorEventLoop by default, so I suspect it is related to this.

Jupyter目前不支持Python 3.8?有解决方法吗?

Jupyter does not support Python 3.8 at the moment? Is there a work around?

推荐答案

编辑

此问题存在于较早的Jupyter Notebook版本中,并已在版本 6.0.3 (2020年1月21日发行)中修复.要升级到最新版本,请运行:

This issue exists in older versions of Jupyter Notebook and was fixed in version 6.0.3 (released 2020-01-21). To upgrade to the latest version run:

pip install notebook --upgrade


通过GitHub解决此问题后,问题似乎与jupyter使用的tornado服务器有关.


Following on this issue through GitHub, it seems the problem is related to the tornado server that jupyter uses.

对于那些迫不及待要进行正式修复的人,我可以通过编辑文件tornado/platform/asyncio.py并添加以下内容使其正常运行:

For those that can't wait for an official fix, I was able to get it working by editing the file tornado/platform/asyncio.py, by adding:

import sys

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

主要进口之后.

但是,我希望很快对此进行正式修复.

I expect an official fix for this soon, however.

这篇关于具有Python 3.8的Jupyter Notebook-NotImplementedError的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆