I would like to keep firefox as my system default browser on my Mac, but launch IPython Notebook in Chrome[1].
This answer led me to my ipython_notebook
For Mac users, the best way is to change the default browser from the system preferences/General, and enjoy your new browser for jupyter notebook.
Since the great switch to Jupyter, and with recent versions of OS X (e.g., Yosemite), Jupyter/iPython (e.g., 4.0.1), and Chrome (e.g., 47), things have changed a bit. Jupyter/iPython no longer puts the notebook config file in ~/.ipython
; it's now in ~/.jupyter
, and the default file is generated with
jupyter notebook --generate-config
If you have an existing ipython_notebook_config.py
you can migrate it with jupyter migrate
(H/T).
After generating or migrating your config file, add the following line to jupyter_notebook_config.py
:
c.NotebookApp.browser = u'/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome %s'
For future reference, this works looks the most elegant way to edit jupyter_notebook_config.py
for me on macOS:
c.NotebookApp.browser = u'open -a "Google Chrome" %s'
You can obviously replace
"Google Chrome"
with any other browser.
Full procedure:
jupyter notebook --generate-config
open ./jupyter/jupyter_notebook_config.py
#c.NotebookApp.browser
and edit it as aboveIf you don't want to open the browser at all, you can add ipython notebook --no-browser
.
This worked for me on OSX Mavericks:
c.NotebookApp.browser = u'/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome %s'
Based on this answer, (running Python 2.7.3 and IPython-0.13.1 on Linux), all I had to set in my ipython_notebook_config.py
was
c.NotebookApp.browser = u'/usr/bin/google-chrome %s'
I'm guessing, setting c.NotebookApp.browser
to /Applications/Browsers/Chrome.app/Contents/MacOS/Google Chrome %s
should work for you.