Changing browser for IPython Notebook from system default

后端 未结 9 1022
南笙
南笙 2021-02-05 09:59

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

相关标签:
9条回答
  • 2021-02-05 10:46

    This might not be the right things to do , but

    $ open -a Google\ Chrome http://localhost:8888
    $ open -a Firefox http://localhost:8888
    

    Works from me (only on mac) to open any url in one of the 2 browser.

    Use the --no-browser option and make an bash function that does that. Or even have a bookmark in Chrome.

    0 讨论(0)
  • 2021-02-05 10:50

    For people who want to make firefox their default for ipython notebooks (where it is not necessarily the system default), adding the following line to ipython_notebook_config.py should be sufficient:

    c.NotebookApp.browser = 'Firefox'

    For me, this was better than linking to the application file directly because it avoids the error: A copy of Firefox is already open. Only one copy of Firefox can be open at a time.

    0 讨论(0)
  • 2021-02-05 10:53

    On OS X, you can put the following in ipython_notebook_config.py to open Chrome:

    c.NotebookApp.browser = u'/usr/bin/open -a Google\\ Chrome %s'
    

    The executable in '/Applications/Google Chrome.app/Contents/MacOS/Google Chrome' fails for me with 'unable to obtain profile lock', so going through 'open' is the only simple alternative I see.

    0 讨论(0)
提交回复
热议问题