Open vscode instead of browser in qiime2 environment

Hi,

Whenever I opened jupyter notebook or ran qiime tools view in my qiime2 environment, vscode got opened instead of the browser. I am not sure how to de-associate vscode. Hope anyone can help if you know.

Thanks,

Xiao

I’m not quite sure how to help you, I think these associations are performed by the Operating System.

In the case you describe I suspect that the issue might be one of the following:

  • Broken Jupyter Notebook install (Repair or reinstall should fix it)

  • Unintended Jupyter Notebook configuration (Reinstall or resetting options to default)

  • Incorrect method of launching Jupyter Notebook (solution depends on the OS and installation)

    • For example, if you click directly on the notebook file (eg. my_notebook.ipnb) the operating will open a text editor instead of launching the Jupyter Notebook server and then opening the editor in the browser.
    • To solve this you should first try launch the Jupyter Notebook server and then select the appropriate notebook from the interface that should appear on the browser.
      For example, if you happen to be using bash on Ubuntu or a terminal in Mac OS, to launch Jupyter Notebook do the following:
      1. Open a terminal and run: $ jupyter notebook
      2. A browser window should pop open with the Jupyter Notebook Interface, from there select the notebook.

The methods to troubleshoot the issue are dependant on which OS you happen to be using and the method you use to launch Jupyter notebook (Eg. Conda Navigator, Terminal, Desktop Launcher).

Thanks for the reply.

I am using ubuntu 18.04, Conda 4.7.5 and qiime2-2019-07.

I launch normally through $jupyter notebook. Here is the observation: in the qiime2 environment, now I have to close the vscode just popped up and click on the link in the terminal to open that address in the browser after launching; However, if I am not in the qiime2 environment, jupyter notebook can be launched normally popping up on the browser. Another observation is that when run$qiime tools view somefile, it pops up vscode as well instead of the browser. I am starting to think it might has to do with conda settings?

Thanks,

Ok, so this is what I found on configuring which program/browser opens up when you launch Jupyter Notebook.

I’m guessing that for Ubuntu 18.04 the line to change is:

c.NotebookApp.browser = u''

To one of the following:

Chromium

c.NotebookApp.browser = u'/usr/bin/chromium-browser %s'

Chrome

c.NotebookApp.browser = u'/usr/bin/google-chrome %s'

Firefox

c.NotebookApp.browser = u'/usr/bin/firefox %s'

In case you happen to use any other browser, you can run the command $ which <browser-name> to find the path to the executable.

Jupyter Notebook Default Browser Configuration
General Jupyter Notebook Server Configuration

Hope it helps!