如何更改 Linux 中 ipython/jupyter notebook 使用的默认浏览器? [英] How to change the default browser used by the ipython/jupyter notebook in Linux?
问题描述
我使用的是 Linux Mint 17.3.
I'm on Linux Mint 17.3.
如何更改 Jupyter notebook 使用的默认浏览器?
How do I change the default browser used by the Jupyter notebook?
我已将笔记本安装为 Anaconda 3 的一部分,它会在我的默认浏览器 Chrome 中打开.但是出于某种原因,Chrome 不会让我创建一个新的 ipynb.单击新建"按钮并没有做任何事情.所以我将笔记本 url 复制到 Firefox,它在那里工作得很好.
I have installed the notebook as a part of Anaconda 3 and it opens up in my default browser—Chrome. But for some reason, Chrome won't let me make a new ipynb. Clicking the 'new' button simply doesn't do anything. So I copied the notebook url to Firefox and it works perfectly fine there.
有什么方法可以让它与 Chrome 一起使用?否则,如何更改默认浏览器?我遇到的通常答案是我必须更改 c.NotebookApp.browser
选项,但我找不到这样做的方法,因为我试图找到 ipython_notebook_config<终端中的/code> 出现了 4 个结果:
Is there a way I can make it work with Chrome? Otherwise, how do I change the default browser? The usual answer I've come across is that I have to change the c.NotebookApp.browser
option, but I can't find a way to do so, since trying to find ipython_notebook_config
in the terminal comes up with 4 results:
./anaconda3/lib/python3.5/site-packages/jupyter_core/tests/dotipython/profile_default/ipython_notebook_config.py
./anaconda3/lib/python3.5/site-packages/jupyter_core/tests/dotipython_empty/profile_default/ipython_notebook_config.py
./anaconda3/pkgs/jupyter_core-4.0.6-py35_0/lib/python3.5/site-packages/jupyter_core/tests/dotipython/profile_default/ipython_notebook_config.py
./anaconda3/pkgs/jupyter_core-4.0.6-py35_0/lib/python3.5/site-packages/jupyter_core/tests/dotipython_empty/profile_default/ipython_notebook_config.py
推荐答案
您可以通过以下方式创建 jupyter_notebook_config.py
:
You can create jupyter_notebook_config.py
by:
jupyter notebook --generate-config
然后你去
~/.jupyter/jupyter_notebook_config.py
和改变
# c.NotebookApp.browser = ''
例如:
c.NotebookApp.browser = '/usr/bin/google-chrome %s'
您可以选择安装哪个浏览器.例如,您将通过键入 which firefox
找到路径不要忘记删除#
You can choose which ever browser is installed. You'll find the path for example by typing which firefox
Do not forget to delete the #
这篇关于如何更改 Linux 中 ipython/jupyter notebook 使用的默认浏览器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!