未打开过 Jupyter,或没有配置文件
1.安装了 Anaconda,在Anaconda prompt中输入以下命令,并回复y。(也可以用来查找已有配置文件路径)
jupyter notebook --generate-config
- 未安装
Anaconda, Jupyter 安装目录下新建配置文件jupyter_notebook_config.py
已在浏览器打开过 Jupyter
-
右单击 Chrome 图标,打开属性,复制目标(高亮位置)的值,也就是Chrome浏览器安装位置

- 找到 Jupyter 的安装目录下的打开配置文件
jupyter_notebook_config.py
- 记得安装目录,直接找
- 参考未安装时的方法1
- 在文件资源管理器中搜索,很慢
- 使用 Everything 软件搜
- 老版找到
# c.NotebookApp.browser =,在下面编辑插入以下代码块。
# 老版
import webbrowser
webbrowser.register("chrome",None,webbrowser.GenericBrowser(u"这里是Chrome浏览器安装位置"))
c.NotebookApp.browser = chrome
新版找到 # c.ServerApp.browser =,在下面编辑插入以下代码块。
# 新版
import webbrowser
webbrowser.register("chrome",None,webbrowser.GenericBrowser(u"C:\Program Files\Google\Chrome\Application\chrome.exe"))
c.ServerApp.browser = chrome
注意更改浏览器位置,然后保存。至此已设置成功,重新打开Jupyter试一试。

- Jupyter 启动后在浏览器中使用URL打开 Notebook
# 启动后是否在浏览器中打开
c.LabServerApp.open_browser = True
# 禁用通过重定向文件启动浏览器,使用URL和可见令牌启动
c.ServerApp.use_redirect_file = False
参考文章:
- 将Chrome设置为Jupyter_notebook的默认浏览器
- 设置Jupyter Notebook的默认浏览器
© 版权声明
文章版权归作者所有,未经允许请勿转载。如内容涉嫌侵权,请在本页底部进入<联系我们>进行举报投诉!
THE END

















暂无评论内容