question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Create new notebook fails, opening existing notebook does not work (Proposed API error).

See original GitHub issue

Environment data

  • VS Code version: 1.61.0
  • Jupyter Extension version: v2021.9.100
  • Python Extension version: v2021.10.1365161279
  • OS and version: Manjaro 21.1.6
  • Python and/or Anaconda version: 3.9.4
  • Type of virtual environment used: conda
  • Jupyter server running: Local

Expected behaviour

A clean install of vscode and the respective extensions should create and open jupyter notebooks properly.

Actual behaviour

  • Opening an existing jupyter notebook enables to create and edit cells, but there is no possibility to execute them.
  • Jupyter: Create New Jupyter Notebook shows error: command 'jupyter.createnewnotebook' not found, nothing more happens.

In both situations, the developer tools console prints the following error:

[ms-python.python]: Proposed API is only available when running out of dev or with the following command line switch: --enable-proposed-api ms-python.python

See trace in screenshot below.

Steps to reproduce:

For my configuration, the following steps did not resolve the error:

  1. uninstall vscode
  2. clear data in ~/.config/Code - OSS/ and ~/.vscode/
  3. install vscode
  4. install python and jupyter extension, select proper python interpreter
  5. try to create a new notebook using Jupyter: Create New Jupyter Notebook or open an existing notebook

Error screenshot

image

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

6reactions
Moarqicommented, Nov 4, 2021

@IanMatthewHuff ah, that totally makes sense! Thank you for your investigation and time, that is something I could have found 😕

I managed to resolve the issue by adding "ms-toolsai.jupyter" to "extensionAllowedProposedApi": [..] in /usr/lib/code/product.json as suggested. Closing the issue.

1reaction
IanMatthewHuffcommented, Nov 3, 2021

Hmmm interesting. I don’t have access to an Arch Linux machine right now, but I’m checking out the docs online. I was a bit confused that there were Code - OSS directories that were listed as those directories are not usually in the official VS Code releases.

Looking around I believe that I see the answer here. It looks like ArchLinux by default installs Code - OSS (which is not the official Microsoft release, but should function normally).

https://wiki.archlinux.org/title/Visual_Studio_Code

The actual official Microsoft release looks like it’s visual-studio-code-bin not code. Looking further into the link above it looks like the “Command Not Found” issue is a known issue with Code - OSS, as Code - OSS doesn’t recognize specific extensions that are allowed to use the proposed API in stable builds. This sounds exactly like the symptoms that you are seeing. I think that the advice would be to add in those extensions (probably Python and Jupyter here) as detailed as here from the above link:

Command "..." not found
In the official build of VS Code, a product.json file lists the extensions that are allowed to use certain proposed APIs accessed by extensions. However, the product.json is absent in the OSS build code. [1]

In the related issues below, some flags may be required to enable certain APIs. [2] You may either run code with these flags, or you can add the relevant entries to the extensionAllowedProposedApi section in the product.json file (code installs this to /usr/lib/code/product.json).

"extensionAllowedProposedApi": [
    "ms-vsliveshare.vsliveshare",
    "ms-vscode.node-debug",
    "ms-vscode.node-debug2"
]
This can also be resolved by installing the code-featuresAUR package, which installs a pacman hook that patches the file on every package update. Alternatively, you may also consider installing the Microsoft branded packages: visual-studio-code-binAUR, visual-studio-code-insiders-binAUR.

Or to install the official Microsoft release of vs code instead of Code - OSS.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Using Proposed API - Visual Studio Code
Proposed APIs are a set of unstable APIs that are implemented in VS Code but not exposed to the public as stable APIs...
Read more >
Cannot open jupyter notebook in VSCode
I have installed the ms-python extension, and also the jupyter package, as described here. However, after reloading, I did not have a command ......
Read more >
Common problems and solutions—ArcGIS Notebook Server
When I try to open a notebook, I get this error: Error opening notebook. Unable to connect to the Docker environment on the...
Read more >
Troubleshooting errors in AWS Glue
If AWS Glue fails to create the notebook server for a development endpoint, it might be because of one of the following problems:...
Read more >
Error Messages Display on a Blue Screen (Windows 10)
1. In Windows, search for and open View advanced system settings. 2. In the Startup and Recovery section, click Settings. 3. Remove the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found