How to start Jupyter notebook in any browser instead of the one specified as the browser you normally use. Linux and Windows are basically the same, but on Mac they are ** slightly ** different. _ (2018/6/18) Vivaldi is also a little different, so I added it. _
Execute the following command in the terminal.
$ jupyter notebook --generate-config
Writing default config to: /Users/(user_name)/.jupyter/jupyter_notebook_config.py
This will create the following files: (It will tell you when you execute the above command properly)
~/.jupyter/jupyter_notebook_config.py
Open the above file with a text editor and look for the following items.
jupyter_notebook_config.py
# c.NotebookApp.browser = ''
Uncomment and change as follows:
jupyter_notebook_config.py
c.NotebookApp.browser = '/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome %s'
If you add the option --new-window
after% s
, it will start in a new window.
-** It seems that it is necessary to specify with a startup option on Mac **, so it is not enough to specify the application path like /Applications/Firefox.app
.
On Linux and Windows, the path of the browser executable file itself is fine.
_ (Added on 2018/6/18) _
** It doesn't seem to be a Mac-specific difference **
Even on Ubuntu, ** Vivaldi ** required % s
. We have not investigated the details of the specifications. I don't know.
--On Mac, in Chrome, there is a space in the application name, so escape the space with `\`
.
--Since the configuration file is a Python script, you may have to add 'u'
to the beginning of the browser path in the Python2 environment.
u'Applications/Google\ Chrome.app/・ ・ ・'
### reference
Click here for a Python script that handles the above settings.
/Users/(user_name)/.pyenv/versions/anacondaX-X.X.X/lib/pythonX.X/webbrowser.py
My environment is pyenv, but please read it as your own environment.
```--new-window```You can see that there are options such as.
Recommended Posts