Jupyter Notebook 无法在 Windows 10 中以 python 3.8 启动 [英] Jupyter notebook cannot start with python 3.8 in Windows 10
本文介绍了Jupyter Notebook 无法在 Windows 10 中以 python 3.8 启动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
这是在 python 版本 3.8 下启动 jupyter notebook 时的详细错误
Here is the detailed error when launching jupyter notebook with python version 3.8
File "c:userskokatappdatalocalprogramspythonpython38lib
unpy.py", line 192, in _run_module_as_main
return _run_code(code, main_globals, None,
File "c:userskokatappdatalocalprogramspythonpython38lib
unpy.py", line 85, in _run_code
exec(code, run_globals)
File "C:UserskokatAppDataLocalProgramsPythonPython38Scriptsjupyter-notebook.EXE\__main__.py", line 9, in <module>
File "c:userskokatappdatalocalprogramspythonpython38libsite-packagesjupyter_coreapplication.py", line 266, in launch_instance
return super(JupyterApp, cls).launch_instance(argv=argv, **kwargs)
File "c:userskokatappdatalocalprogramspythonpython38libsite-packages raitletsconfigapplication.py", line 657, in launch_instance
app.initialize(argv)
File "<c:userskokatappdatalocalprogramspythonpython38libsite-packagesdecorator.py:decorator-gen-7>", line 2, in initialize
File "c:userskokatappdatalocalprogramspythonpython38libsite-packages raitletsconfigapplication.py", line 87, in catch_config_error
return method(app, *args, **kwargs)
File "c:userskokatappdatalocalprogramspythonpython38libsite-packages
otebook
otebookapp.py", line 1628, in initialize
self.init_webapp()
File "c:userskokatappdatalocalprogramspythonpython38libsite-packages
otebook
otebookapp.py", line 1407, in init_webapp
self.http_server.listen(port, self.ip)
File "c:userskokatappdatalocalprogramspythonpython38libsite-packages ornado cpserver.py", line 144, in listen
self.add_sockets(sockets)
File "c:userskokatappdatalocalprogramspythonpython38libsite-packages ornado cpserver.py", line 157, in add_sockets
self._handlers[sock.fileno()] = add_accept_handler(
File "c:userskokatappdatalocalprogramspythonpython38libsite-packages ornado
etutil.py", line 268, in add_accept_handler
io_loop.add_handler(sock, accept_handler, IOLoop.READ)
File "c:userskokatappdatalocalprogramspythonpython38libsite-packages ornadoplatformasyncio.py", line 79, in add_handler
self.asyncio_loop.add_reader(
File "c:userskokatappdatalocalprogramspythonpython38libasyncioevents.py", line 498, in add_reader
raise NotImplementedError
NotImplementedError
任何帮助将不胜感激.
推荐答案
遵循 这个线程,我已经解决了这个问题:
Following one of the comments in this thread, I've solved the problem by:
- 找到并打开 asyncio.py 文件.就我而言,它位于
C:Users[USERNAME]AppDataLocalProgramsPythonPython38-32Libsite-packages ornadoplatform
- 在
import asyncio
行之后添加以下内容:
- Locate and open the asyncio.py file. In my case it's in
C:Users[USERNAME]AppDataLocalProgramsPythonPython38-32Libsite-packages ornadoplatform
- After the line
import asyncio
add the following:
from sys import platform
if platform == "win32":
asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy()) # python-3.8.0a4
这将强制在 Windows 上使用 SelectorEventLoop.
This will force using SelectorEventLoop on Windows.
这篇关于Jupyter Notebook 无法在 Windows 10 中以 python 3.8 启动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文