'Unable to save Jupyter notebook in VS Code

I have been trying to save my jupyter notebook in the '.ipynb' format but am unable to do so, in whatsover extension. I encounter the following error message

Failed to save 'Untitled-1': File name file:///c%3A/Users/parni/OneDrive/Desktop/MINIPROJECT/INPUT/prac.py is not supported by Jupyter.

Please make sure the file name matches following patterns:

I am also not able to extend and check out what pattern should I follow it will be great if anyone could help me out.



Solution 1:[1]

Goto File -> Save As, in "Save as Type" select No Extension and save the file with file name "name".ipynb

Solution 2:[2]

I had a similar issue with VSCode. To resolve this Press-> CTRL+SHIFT+P and then JSON: Clear Schema Cache

Solution 3:[3]

I had a similar issue - I believe it has to do with the update to VS Code notebooks.

I resolved it with the following steps:

  • Open settings.json (CTRL + SHIFT + P --> Open Settings JSON)
  • Change "workbench.editorAssociations": {"*.ipynb": "jupyter.notebook.ipynb"} to "workbench.editorAssociations": {"*.ipynb": "jupyter.notebook"}. You're just deleting the .ipynb portion.

This should cause VS Code to read/write the notebooks correctly.

Details on the GitHub thread that led me to this solution can be found here.

Solution 4:[4]

I completely uninstalled VS code and It started working for .ipynb files. Followed the steps below. I have referred this solution from another thread of stackoverflow. I am not able to find the same hence adding answer below.

  1. Uninstallation from Add remove program
  2. Delete folder "C:\Users[user Name]\AppData\Roaming\Code".
  3. Reinstalled VScode with all extensions.

Solution 5:[5]

I had the same problem. In your VS code environment,

  • search Jupyter in the Extensions
  • uninstall Jupyter and re-install it
  • You save the code without any changes.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Thilina Madushan
Solution 2 Aman Vishnoi
Solution 3
Solution 4 Tushar
Solution 5 Mehdi Sameie