Launch IPython notebook with selected browser Launch IPython notebook with selected browser python python

Launch IPython notebook with selected browser


I had the same problem on windows and got it work this way:

  • Create a config file with commandipython profile create default

  • Edit ipython_notebook_config.py file, search for line

#c.NotebookApp.browser =''

and replace it with

import webbrowserwebbrowser.register('firefox', None, webbrowser.GenericBrowser('C:\\Program Files (x86)\\Mozilla Firefox\\firefox.exe'))c.NotebookApp.browser = 'firefox'

then it works for me.

Hope it will help you.

JPG


On my mac, I got the following command to use Firefox instead of my default Chrome:

jupyter notebook --browser firefox


This is not a real answer. I just want to share with the less computer savvy what JPG's answer looks like step-by-step. Presumably, on Windows Explorer (screen capture attached below), the file jupyter_notebook_config.py is listed:

enter image description here

In my case, the directory for the file (on top menu of Explorer) was C:\Users\My_name\.jupyter

The second part of the answer can be implemented by simply pasting:

import webbrowserwebbrowser.register('firefox', None, webbrowser.GenericBrowser('C:\\Program Files (x86)\\Mozilla Firefox\\firefox.exe'))c.NotebookApp.browser = 'firefox'

in the space on the space seen on the screen capture below, corresponding to the jupyter_notebook_config.py opened within PyCharm:

enter image description here

... only that I set it up to open in Opera:

import webbrowserwebbrowser.register('opera', None, webbrowser.GenericBrowser('C:\\Program Files (x86)\\Opera\\launcher.exe'))c.NotebookApp.browser = 'opera'