jupyter notebook execution error: "http://localhost:8889/tree?token=xxx" doesn’t understand the “open location” message
I got this error when I tried to launch jupyter notebook on a mac. It is not a fatal error. I could still go to browser directly and copy/paste the url manually. The error indicates that when the command automatically tried to launch a browser, it couldn't find the default browser in jupyter configuration file. The easy fix is to specify the browser. Here are the steps to do so;
1. Open ~/.jupyter/jupyter_notebook_config.py in an editor.
If the file does not exist then you can create a default config file by typing the following command;
jupyter notebook --generate-config
2. Search for a word "browser" to locate a following line.
#c.NotebookApp.browser = ''
By default it is commented. You can uncomment it and use one of the following values depending on your browser preference.
# set default browser to chrome
c.NotebookApp.browser = 'chrome'
# set default browser to safari
c.NotebookApp.browser = 'Safari'
That resolved the problem for me. If it still doesn't work for you then you could try setting BROWSER variable in ~/.bash_profile as follows;
export BROWSER=<browser-location>
For example;
export BROWSER=/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome
1. Open ~/.jupyter/jupyter_notebook_config.py in an editor.
If the file does not exist then you can create a default config file by typing the following command;
jupyter notebook --generate-config
2. Search for a word "browser" to locate a following line.
#c.NotebookApp.browser = ''
By default it is commented. You can uncomment it and use one of the following values depending on your browser preference.
# set default browser to chrome
c.NotebookApp.browser = 'chrome'
# set default browser to safari
c.NotebookApp.browser = 'Safari'
That resolved the problem for me. If it still doesn't work for you then you could try setting BROWSER variable in ~/.bash_profile as follows;
export BROWSER=<browser-location>
For example;
export BROWSER=/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome
Comments