Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.2k views
in Technique[技术] by (71.8m points)

google chrome - How to change the default browser used by the ipython/jupyter notebook in Linux?

I'm on Linux Mint 17.3.

How do I change the default browser used by the Jupyter notebook?

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.

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
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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 %s'

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 #


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

1.4m articles

1.4m replys

5 comments

57.0k users

...