当前位置:  开发笔记 > 编程语言 > 正文

如何在Safari中启动Jupyter Notebook?

如何解决《如何在Safari中启动JupyterNotebook?》经验,为你挑选了1个好方法。

我在Mac OS上,我的默认浏览器是Firefox.

在终端,我跑了jupyter notebook --generate-config.然后,在文本编辑器中,我打开〜/ .jupyter/jupyter_notebook_config.py

我换c.NotebookApp.browser = u''c.NotebookApp.browser = u'/Applications/Safari.app/Contents/MacOS/Safari %s'

但是,当我运行时jupyter notebook,我得到以下输出:

```
[I 15:14:23.717 NotebookApp] [nb_conda_kernels] enabled, 3 kernels found
[I 15:14:24.586 NotebookApp] [nb_anacondacloud] enabled
[I 15:14:24.589 NotebookApp] [nb_conda] enabled
[I 15:14:24.626 NotebookApp] ? nbpresent HTML export ENABLED
[W 15:14:24.626 NotebookApp] ? nbpresent PDF export DISABLED: No module named nbbrowserpdf.exporters.pdf
[I 15:14:24.632 NotebookApp] Serving notebooks from local directory: /Users/ironaut/Tutorials/DAND/Jupyter
[I 15:14:24.632 NotebookApp] 0 active kernels 
[I 15:14:24.632 NotebookApp] The Jupyter Notebook is running at: http://localhost:8888/?token=74a348c3fdec07e929dde216c244e1a9164badc47f079819
[I 15:14:24.632 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
Failed to acquire exclusive access to history store at file:///Users/ironaut/Library/Safari/History.db. Falling back to an in-memory history store.
[W 15:22:55.201 NotebookApp] 401 POST /login?next=%2Ftree%3F (::1) 1.30ms referer=http://localhost:8888/login?next=%2Ftree%3F
```

如果没有配置文件的更改,jupyter在Firefox中启动就可以了.



1> Drj..:

你几乎完成了所有步骤.为了读者的利益重新迭代.

确保这firefox是默认浏览器.或任何其他浏览器.

atom用作文本编辑器.随意使用任何其他.

执行

$ jupyter notebook --generate-config
$ atom ~/.jupyter/jupyter_notebook_config.py

找到并改变

c.NotebookApp.browser = u''

c.NotebookApp.browser = u'/usr/bin/open -a Safari %s'

测试

$ jupyter notebook


如果这解决了你的问题,那么通常会接受答案,以便其他人知道它有效,所以帮助你的人会获得积分.
推荐阅读
保佑欣疼你的芯疼
这个屌丝很懒,什么也没留下!
DevBox开发工具箱 | 专业的在线开发工具网站    京公网安备 11010802040832号  |  京ICP备19059560号-6
Copyright © 1998 - 2020 DevBox.CN. All Rights Reserved devBox.cn 开发工具箱 版权所有