如何更改Linux中ipython / jupyter笔记本使用的默认浏览器? [英] How to change the default browser used by the ipython/jupyter notebook in Linux?

查看:1239
本文介绍了如何更改Linux中ipython / jupyter笔记本使用的默认浏览器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Linux Mint 17.3上。如何更改Jupyter笔记本使用的默认浏览器?我已经安装了笔记本作为Anaconda 3的一部分,并且在我的默认浏览器Chrome中打开。但由于某种原因,Chrome不会让我做一个新的ipynb。点击新建按钮根本不会做任何事情。所以我把笔记本的网址复制到了Firefox,并且在那里效果很好。



有没有办法使其与Chrome一起工作?否则,我该如何更改默认浏览器?我遇到的常见答案是我必须更改 c.NotebookApp.browser 选项,但是我找不到这样做的方法,因为尝试在终端上找到 ipython_notebook_config ,出现了4个结果:

 。 /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

  jupyter notebook --generate-confi g 

然后你去

<$ p $ 〜/ .jupyter / jupyter_notebook_config.py

并更改

 #c.NotebookApp.browser =''

为例:

  c.NotebookApp.browser ='/ usr / bin / google -chrome'

您可以选择安装哪个浏览器。例如你可以通过输入 firefox来找到路径
不要忘记删除#


I'm on Linux Mint 17.3. How do I change the default browser used by the Jupyter notebook? I've installed the notebook as a part of Anaconda 3, and it opens up in my default browser, which is 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.

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've gotta 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

解决方案

You can create jupyter_notebook_config.py by:

jupyter notebook --generate-config

Then you go to

~/.jupyter/jupyter_notebook_config.py

and change

# c.NotebookApp.browser = ''

to for example:

c.NotebookApp.browser = '/usr/bin/google-chrome'

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笔记本使用的默认浏览器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆