Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to open Jupyter Notebooks: Using the Jupyter notebook editor requires the stable version of VS code and the CustomEditor experiment to be enabled.. #3988

Closed
xcojonny opened this issue Nov 20, 2020 · 24 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug

Comments

@xcojonny
Copy link

Environment data

  • VS Code version: 1.51.1
  • Extension version (available under the Extensions sidebar): XXX
  • Jupyter Extension version (available under the Extensions sidebar): v2020.11.372831992
  • OS (Windows | Mac | Linux distro) and version: Win10
  • Python and/or Anaconda version: Python 3.8.1
  • Type of virtual environment used (N/A | venv | virtualenv | conda | ...): N/A
  • Jupyter server running: Local and Remote

Expected behaviour

Clicking on a Jupyter-Notebook opens the notebook.

Actual behaviour

Clicking on a Jupyter-Notebook opens the Notebook for a second. Then the file is being closed and the following error is displayed:
Unable to open '[*].ipynb': Using the Jupyter notebook editor requires the stable version of VS code and the CustomEditor experiment to be enabled..

This behaviour occurred suddenly, without me changing knowingly anything in VSC. The Notebooks can still be opened on different machines. Furthermore creating a new Notebook works.

Steps to reproduce:

  1. Try to open any jupyter notebook within VSC over the side bar -> Leads to error
  2. Opening via terminal (code file.ipynb) -> Leads to error

Logs

User belongs to experiment group 'jupyterTest'

@xcojonny xcojonny added the bug Issue identified by VS Code Team member as probable bug label Nov 20, 2020
@takotab
Copy link

takotab commented Nov 20, 2020

Same issue on ubuntu 20.04

@rchiodo
Copy link
Contributor

rchiodo commented Nov 20, 2020

@claudiaregio this might be a side effect of the custom editor experiment being turned on.

@rchiodo
Copy link
Contributor

rchiodo commented Nov 21, 2020

This shouldn't be happening but might be caused by this setting being in your user settings.json:

    "workbench.editorAssociations": [
        {
            "viewType": "jupyter.notebook.ipynb",
            "filenamePattern": "*.ipynb"
        }
    ],

Can you check if that editor association is there?

This would likely cause the bug above.

We think you can workaround this bug by:

  1. Deleting this section from your user settings.json
    or
  2. Add this additional setting to your settings.json:
    "jupyter.experiments.optInto": [
        "CustomEditor"
    ],

@greazer
Copy link
Member

greazer commented Nov 21, 2020

One other question. @xcojonny, @takotab, do either of you have "Settings Sync" turned on (keep it off, if you've not ever turned it on).

image

@PeterMakus
Copy link

This shouldn't be happening but might be caused by this setting being in your user settings.json:

    "workbench.editorAssociations": [
        {
            "viewType": "jupyter.notebook.ipynb",
            "filenamePattern": "*.ipynb"
        }
    ],

Can you check if that editor association is there?

This would likely cause the bug above.

We think you can workaround this bug by:

1. Deleting this section from your user settings.json
   or

2. Add this additional setting to your settings.json:
    "jupyter.experiments.optInto": [
        "CustomEditor"
    ],

I experienced exactly the same issue and was able to circumvent the problem by following your instructions. Thanks!

@greazer
Copy link
Member

greazer commented Nov 21, 2020

@PeterMakus, good to hear! Did you happen to have "Settings Sync" turned on or know that you've ever turned it on? It's ok if you don't remember. Just looking for clues as to how these settings are getting messed up.

@PeterMakus
Copy link

No, that setting was turned off.

@xcojonny
Copy link
Author

Hello,

@rchiodo: thanks a lot first!!! Deleting the section worked for me. Adding the section did not work!

@greazer: I'm using SettingsSync.

@warmbadetag
Copy link

warmbadetag commented Nov 23, 2020

Hi all,

I had this issue despite not having the editor association in settings.json

Adding the second section from @rchiodo's post resolved this issue, however.

@DonJayamanne
Copy link
Contributor

DonJayamanne commented Nov 23, 2020

@PeterMakus @xcojonny @warmbadetag
Are you using VS Code insiders or Stable?

@DonJayamanne
Copy link
Contributor

@IanMatthewHuff I think the problem could be that users are falling into the custom editor experiment (now that its enabled) & they are also using insiders (this could be a serious issue for those using VS Code insiders if this is true & might require a point fix) or at some point tried native notebooks.

@PeterMakus
Copy link

@DonJayamanne I'm on the latest stable for ubuntu.

@claudiaregio
Copy link
Contributor

@IanMatthewHuff I think the problem could be that users are falling into the custom editor experiment (now that its enabled) & they are also using insiders (this could be a serious issue for those using VS Code insiders if this is true & might require a point fix) or at some point tried native notebooks.

Experiment is for stable only

@DonJayamanne
Copy link
Contributor

Tried this my self today (no issues), will be a tough one to validate.

@IanMatthewHuff
Copy link
Member

@DonJayamanne Agreed. I tried turning custom editor on and off in stable and using native notebooks in insiders. I think at the bug bash I'll try manually adding in the custom editor association to my settings and seeing if it gets removed when I'm not in the experiment.

@biplavc
Copy link

biplavc commented Nov 27, 2020

This shouldn't be happening but might be caused by this setting being in your user settings.json:

    "workbench.editorAssociations": [
        {
            "viewType": "jupyter.notebook.ipynb",
            "filenamePattern": "*.ipynb"
        }
    ],

Can you check if that editor association is there?
This would likely cause the bug above.
We think you can workaround this bug by:

1. Deleting this section from your user settings.json
   or

2. Add this additional setting to your settings.json:
    "jupyter.experiments.optInto": [
        "CustomEditor"
    ],

I experienced exactly the same issue and was able to circumvent the problem by following your instructions. Thanks!

The first option of deleting the entry worked while the second option of adding the new entry didn't.

Version: 1.51.1
Commit: e5a624b788d92b8d34d1392e4c4d9789406efe8f
Date: 2020-11-10T23:31:29.624Z
Electron: 9.3.3
Chrome: 83.0.4103.122
Node.js: 12.14.1
V8: 8.3.110.13-electron.0
OS: Linux x64 5.4.0-54-generic

@crsd612
Copy link

crsd612 commented Dec 26, 2020

This shouldn't be happening but might be caused by this setting being in your user settings.json:

    "workbench.editorAssociations": [
        {
            "viewType": "jupyter.notebook.ipynb",
            "filenamePattern": "*.ipynb"
        }
    ],

Can you check if that editor association is there?

This would likely cause the bug above.

We think you can workaround this bug by:

  1. Deleting this section from your user settings.json
    or
  2. Add this additional setting to your settings.json:
    "jupyter.experiments.optInto": [
        "CustomEditor"
    ],

None of the options worked for me

@SSamiKocaaga
Copy link

This shouldn't be happening but might be caused by this setting being in your user settings.json:

    "workbench.editorAssociations": [
        {
            "viewType": "jupyter.notebook.ipynb",
            "filenamePattern": "*.ipynb"
        }
    ],

Can you check if that editor association is there?

This would likely cause the bug above.

We think you can workaround this bug by:

  1. Deleting this section from your user settings.json
    or
  2. Add this additional setting to your settings.json:
    "jupyter.experiments.optInto": [
        "CustomEditor"
    ],

It worked for me thanks.

br3ndonland added a commit to br3ndonland/dotfiles that referenced this issue Jan 28, 2021
027531e
microsoft/vscode-jupyter#3988
https://github.com/microsoft/vscode-jupyter/releases/tag/2020.11.2

https://github.com/microsoft/vscode-python recently refactored the
Jupyter Notebook features into a separate extension, ms-toolsai.jupyter.
It's not yet available on https://open-vsx.org/, but it can be manually
downloaded from the VSCode marketplace as a VSIX if necessary, from
https://marketplace.visualstudio.com/items?itemName=ms-toolsai.jupyter.

Extension version 2020.11.2 auto-updated its editor associations.
@jonahpearl
Copy link

Also having this issue with particularly large .ipynb files. I can open smaller ones and edit / run them no problem (< 20 MB), but bigger ones (> 50 MB) render as text and either take ~one minute to render as notebooks, or it gives up and I get this message. Solution #1 is n/a, I don't have those settings, solution #2 didn't work, I have stable build for Mac.

br3ndonland added a commit to br3ndonland/dotfiles that referenced this issue Feb 26, 2021
027531e
microsoft/vscode-jupyter#3988
https://github.com/microsoft/vscode-jupyter/releases/tag/2020.11.2

https://github.com/microsoft/vscode-python recently refactored the
Jupyter Notebook features into a separate extension, ms-toolsai.jupyter.
It's not yet available on https://open-vsx.org/, but it can be manually
downloaded from the VSCode marketplace as a VSIX if necessary, from
https://marketplace.visualstudio.com/items?itemName=ms-toolsai.jupyter.

Extension version 2020.11.2 auto-updated its editor associations.
@david-waterworth
Copy link

david-waterworth commented Mar 16, 2021

I'm getting this after upgrading to 1.54.2, I've made no other changes. Removing

"workbench.editorAssociations": [
{
"viewType": "jupyter.notebook.ipynb",
"filenamePattern": "*.ipynb"
}
],

Causes the file to be opened as text rather than a notebook.

@rchiodo
Copy link
Contributor

rchiodo commented Mar 16, 2021

@david-waterworth did you also upgrade your jupyter extension? If you upgrade VS code to 1.54, it requires an upgrade to the jupyter extension to work

@david-waterworth
Copy link

david-waterworth commented Mar 16, 2021

@rchiodo no I didn't, but none of my extensions are showing new versions. It shows that there are no new extensions.

Jupyter is v2021.3.619093157

@david-waterworth
Copy link

david-waterworth commented Mar 16, 2021

@rchiodo I "fixed" it by removing and reinstalling the Juyper extension (which also required removing the Python and Pylance extensions), along with any jupyter related setting in my config file.

It reinstalled the same version (v2021.3.619093157) so I guess there was an incompatible setting from a previous version somewhere.

@blakeNaccarato
Copy link

blakeNaccarato commented Apr 23, 2021

I had this issue as well, but implementing the advice above didn't work. I managed to fix it, but only by restoring a notebook.kernelProviderAssociations setting from a previous known-good configuration of my settings.json. I've reproduced the relevant settings in my user settings.json that finally got the new "preview" experience back. I guess the "old" experience is called "custom"?

Note that I am explicitly passing empty lists to the optInto and optOutFrom keys. The experiments that you belong to varies month-to-month, so I don't know about the longevity of having those keys set that way. I figured I'd include them here for clarity.

Relevant keys that actually worked in my current user settings.json

{
    \\ ... OTHER SETTINGS ... \\

    "jupyter.experiments.enabled": true,
    "jupyter.experiments.optInto": [],
    "jupyter.experiments.optOutFrom": [],
    "workbench.editorAssociations": [
        {
            "viewType": "jupyter-notebook",
            "filenamePattern": "*.ipynb",
        },
    ],
    "notebook.kernelProviderAssociations": [
        {
            "viewType": "jupyter-notebook",
            "kernelProvider": "ms-toolsai.jupyter",
        },
    ],

    \\ ... OTHER SETTINGS ... \\
}

Here I have trimmed down the settings to what I suspect are the only necessary ones...

Minimal settings.json, probably?

{
    \\ ... OTHER SETTINGS ... \\

    "jupyter.experiments.enabled": true,
    "workbench.editorAssociations": [
        {
            "viewType": "jupyter-notebook",
            "filenamePattern": "*.ipynb",
        },
    ],
    "notebook.kernelProviderAssociations": [
        {
            "viewType": "jupyter-notebook",
            "kernelProvider": "ms-toolsai.jupyter",
        },
    ],

    \\ ... OTHER SETTINGS ... \\
}

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 5, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug
Projects
None yet
Development

No branches or pull requests