-
Notifications
You must be signed in to change notification settings - Fork 765
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
Jupyter notebook raises error: "NO notebook document" in VSCode (WSL v2) #5034
Comments
We don't control execution, so I don't think this would be a Pylance issue. Transferring to the Jupyter extension. |
Disabling or rolling back pylance seems to be the workaround for now. Related: microsoft/vscode#196740 |
Hmm, maybe we are somehow messing up execution. I don't see how we could, but it's worth a look. |
@KacieKK can you try to reproduce the problem? |
I can't reproduce myself. Cells execute fine. I do get a problem with intellisense not working anymore, but that's been fixed in 2023.10.53. |
When I first encountered the bug, I was able to reliably trigger it by clicking an error in the Problems pane, which then jumped to the error in a new temporary window -- by which I mean the sort of window with an italicized filename that gets automatically overwritten by the next command that opens a temporary window. The filename was identical to my original file (which I opened manually in a normal window), but fading for unused definitions and squiggles for errors only appeared in the temporary window, not in the original. Closing the temporary window resulted in the "NO notebook document" error. After one or two rounds of this, however, it just stopped working entirely whether or not I opened and closed the weird temporary window. This issue may be related: microsoft/vscode#173494. |
The problem disappears when downgrading to |
I met same problem. |
This problem may be caused by the accumulated visualized outputs that you made. Clear all outputs in your .ipynb!! |
Having the same issue on Ubuntu after the latest update |
Same issue, changing the Pylance version seems to fix it for now. Was able to replicate on server on Ubuntu and WSL2. |
I was having this problem before 2023.10.40 on WSL, maybe there is something else going on. |
It also works for me :D The only enabled extensions in my test environment are |
Change |
same here - rolling back pylance solved, rolling back jupyter did nothing |
same here. switch python language server from pylance to jedi. then I got no such annoying errors anymore. |
This worked for me |
Still getting this error in the latest Pylance version (2024.6.1) on Debian 12 |
True for me as well I get the error in WSL though. |
I don't believe this error is actually caused by us. It's returned by VS code itself when it can't find a notebook document anymore. We'd really need a repro in order to figure out if there's something we can do about it. |
Having this exact same problem in WSL2, can confirm downgrading fixed the issue so far. |
Anybody that is hitting this issue, if you could provide steps on what you did to cause the problem, we'd greatly appreciate it. |
I'm experiencing an issue where the Jupyter Notebook kernel in VSCode unexpectedly dies, requiring me to restart VSCode. This occurs in two scenarios: After a period of inactivity (approximately one minute or sometimes 2) To reproduce the issue: Create a new Jupyter Notebook in VSCode import pandas as pd
import numpy as np
df = pd.DataFrame(np.random.randn(6, 4), columns=list('ABCD')) Leave the notebook idle for about a minute Environment: P.S |
@mohammadmoein, your problem would not be related to Pylance. You should log an issue on the Jupyter extension here: |
now is July 2024 and the problem has not been resolved yet, are u joking with us? DEAR developers? |
Perhaps you missed my comment. We can't reproduce this in house. If you have a consistent repro, we'd love to try it. |
we simply open vs code in WSL2, create .ipynb files, start writing code, try to run cell, try to run another cell, try another, and try to run another cell but did not run. why? Pylance crashed. it works in .py files without any problem. i downgraded to 20 versions earlier but did not work. (tried all 20 version) take a look this output from python lang server. it worked only 10 min. 2024-07-27 09:20:49.746 [info] [Info - 9:20:49 AM] (1189) Pylance language server 2023.10.40 (pyright 088ebaa5) starting 2024-07-27 09:20:50.141 [info] [Info - 9:20:50 AM] (1189) Setting pythonPath for service "Type A copy": "/home/sat/venvs/moo-pymoo/bin/python" 2024-07-27 09:27:51.571 [info] [Info - 9:27:51 AM] (1189) Starting service instance "Type A copy" 2024-07-27 09:27:55.348 [info] [Info - 9:27:55 AM] (1189) [BG(2)] Long operation: analyzing: /home/sat/codes/foo/moo/courtyard-pro/Type A copy/opt.ipynb:pylance-notebook-cell:X11sdnNjb2RlLXJlbW90ZQ==.py (2633ms) 2024-07-27 09:40:22.693 [info] Error: Debug Failure. False expression: Chained file path /home/sat/codes/foo/moo/courtyard-pro/Type A copy/opt.ipynb:pylance-notebook-cell:pylancePrefixCell.py doesn't match cellFilePaths /home/sat/codes/foo/moo/courtyard-pro/Type A copy/opt.ipynb:pylance-notebook-cell:W1sdnNjb2RlLXJlbW90ZQ==.py 2024-07-27 09:43:22.824 [info] [Error - 9:43:22 AM] Sending DidCloseNotebookDocumentNotification failed |
I find that the problem is going with Continue AI assistant, when I disabled continue everything works well. guys please migrate to this issue continuedev/continue#1463 |
If someone not using Continue but WSL2 or Azure, some discussions (and maybe solutions) are here: microsoft/vscode-jupyter#15716 |
Thanks for posting. For chained path issue, which is different to this original post, please track it in #6169. |
Workable, solved my problem. Disabled Continue Dev then things are fine now. |
Environment data
Repro Steps
x = range(10)
and paste into a new cell.Expected behavior
Cell executes normally, Pylance features such as syntax highlighting remain intact.
Actual behavior
The following notification appears in VSCode and the notebook hangs indefinitely:
NO notebook document for 'file:///*.ipynb'
Logs
The text was updated successfully, but these errors were encountered: