这个问题网上已经有一堆回答了,如:
解决Jupyter-notebook不自动跳转浏览器的详细方法
Python基础090:解决jupyter notebook无法自动跳转chrome浏览器的问题
我这里的情况是针对浏览器路径设置的问题,这是你尝试解决之后还是打不开的主要原因。
首先,一定要进入浏览器属性,进行目标位置查看和复制,而非浏览器快捷方式路径:
这个不对:
这是对的:
image.png
在
jupyter_notebook_config.py
中修改,注意粘贴上述路径后去掉双引号。保存后即可。
image.png
但是我用chrome却不行,首先快捷方式路径和属性中路径是一样的:
image.png
启动时报错:
[W 2023-06-08 16:06:56.286 ServerApp] Could not determine npm prefix: [WinError 2] 系统找不到指定的文件。
[I 2023-06-08 16:06:56.335 ServerApp] Skipped non-installed server(s): bash-language-server, dockerfile-language-server-nodejs, javascript-typescript-langserver, jedi-language-server, julia-language-server, pyright, python-language-server, python-lsp-server, r-languageserver, sql-language-server, texlab, typescript-language-server, unified-language-server, vscode-css-languageserver-bin, vscode-html-languageserver-bin, vscode-json-languageserver-bin, yaml-language-server
[W 2023-06-08 16:06:59.717 LabApp] Could not determine jupyterlab build status without nodejs
[W 2023-06-08 16:07:01.103 ServerApp] 404 GET /api/kernels/3e36d25d-dc56-4785-b9f3-c41ed6cca621/channels?session_id=5fd504f5-ec46-4964-81f9-718e91d1f3b3 (::1): Kernel does not exist: 3e36d25d-dc56-4785-b9f3-c41ed6cca621
[W 2023-06-08 16:07:01.141 ServerApp] 404 GET /api/kernels/3e36d25d-dc56-4785-b9f3-c41ed6cca621/channels?session_id=5fd504f5-ec46-4964-81f9-718e91d1f3b3 (e3ebc33dcfd6407f85581c99b553cd5b@::1) 40.44ms referer=None
[W 2023-06-08 16:07:01.145 ServerApp] 404 GET /api/kernels/3e36d25d-dc56-4785-b9f3-c41ed6cca621?1686211621141 (::1): Kernel does not exist: 3e36d25d-dc56-4785-b9f3-c41ed6cca621
[W 2023-06-08 16:07:01.149 ServerApp] wrote error: 'Kernel does not exist: 3e36d25d-dc56-4785-b9f3-c41ed6cca621'
Traceback (most recent call last):
File "D:\Software\Python39\lib\site-packages\tornado\web.py", line 1786, in _execute
result = await result
File "D:\Software\Python39\lib\site-packages\jupyter_server\services\kernels\handlers.py", line 73, in get
model = await ensure_async(km.kernel_model(kernel_id))
File "D:\Software\Python39\lib\site-packages\jupyter_server\services\kernels\kernelmanager.py", line 501, in kernel_model
self._check_kernel_id(kernel_id)
File "D:\Software\Python39\lib\site-packages\jupyter_server\services\kernels\kernelmanager.py", line 532, in _check_kernel_id
raise web.HTTPError(404, "Kernel does not exist: %s" % kernel_id)
tornado.web.HTTPError: HTTP 404: Not Found (Kernel does not exist: 3e36d25d-dc56-4785-b9f3-c41ed6cca621)
[W 2023-06-08 16:07:01.153 ServerApp] 404 GET /api/kernels/3e36d25d-dc56-4785-b9f3-c41ed6cca621?1686211621141 (e3ebc33dcfd6407f85581c99b553cd5b@::1) 8.21ms referer=http://localhost:8888/lab
找不到具体原因,可能是路径中含有中文???
不管了,就用edge吧,不妨碍。
网友评论