如何安装python3.8.3的notebook_Jupyter Notebook with Python 3.8-NotImplementedError

在升级到Python 3.8并安装jupyter后,运行jupyter notebook时遇到NotImplementedError。错误可能与Python 3.8在Windows上默认使用ProactorEventLoop有关。Jupyter Notebook当前不支持Python 3.8,但可以通过升级notebook到6.0.3以上版本或在tornado/platform/asyncio.py文件中添加代码来临时解决此问题。
摘要由CSDN通过智能技术生成

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

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

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

解决方案

EDIT

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

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

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())

After the main imports.

I expect an official fix for this soon, however.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值