vscode-jupyter
vscode-jupyter copied to clipboard
Support a scratchpad for a jupyter notebook
Is there a way to have an interactive command line that is connected to a jupyter notebook? Not a python script divided up into "jupyter cells", which works fine, but a notebook. Running 'Jupyter : Create Interactive Window" creates a shell that doesn't see the variables in Jupyter Notebook's workspace. This functionality was available in plain Jupyter , run in a browser, using the "Scratch Pad" extension. Thanks.
Thanks for the suggestion, I know that we've batted around the idea of a scratchpad extension a few times for VS Code. We'll put it in for consideration. Personally I think it would be an excellent addition.
Thank you. Are you aware of any workarounds?
Thank you. Are you aware of any workarounds?
Hi @mischki have you found any workarounds in the meantime :)? Really slows down my trial–and-error development process I became so used to when using the VSCode python debugger.
Cheers, Phil
Thank you. Are you aware of any workarounds?
Hi @mischki have you found any workarounds in the meantime :)? Really slows down my trial–and-error development process I became so used to when using the VSCode python debugger.
Cheers, Phil
Hi Phil, I'm still using Jupyter in Chrome and anxiously googling about this every week. There seems to be no interest among the developers.
@mischki
Cheers! Seems like I managed to got it working. (can use the Jupyter Notebook variables in the interactive window now. A bit of a process but imho worth it :D)
The process
- Command + Shift + P
- Jupyter: Create Interactive Window
- Copy URL of Remote Jupyter Session
- again: Command + Shift + P -> Jupyter: Specify local or remote Jupyter server for connections
- Paste URL of Remote Jupyter Session
- In the interactive window select the current session (remote)
- That's it! The active variables from the Jupyter Notebook should now available in the interactive console
Hi. Is your Jupyter Notebook opened within VSCode or in a browser? If in VSCode, how do you copy its url? Thanks.
@mischki haha, that's a bit tricky indeed: I copy the entire block, paste it in the execution field and from there I can easily copy the URL (no need to touch the browser, everything in VSCode)


Sorry, I'm quite new to VSCode. How do you get to that window (first picture) from where you copy the URL? When I open a Jupyter notebook in VSCode I don't see a window with a URL like that. Thanks.
This one gets you to the interactive window. (Command - Shift - P (guess something similar when you're using Windows / Linux)) Hope that helps :)
I meant this one
I meant this one
When I start a Jupyter Interactive Window this is what I get
No URL anywhere. So I still don't know how to get the URL of the Notebook's kernel to paste into the interactive window.
What am I missing?
Thanks
Yes, I'm also really missing the console in Jupyterlab. Here's a related vscode request too: #100061
@mischki Now it also happened to me - there was no URL shown anymore in the March 2022 version of VSCode - so I downgraded to the Feb version and it started working again 🤷🏽♂️
@mischki Now it also happened to me - there was no URL shown anymore in the March 2022 version of VSCode - so I downgraded to the Feb version and it started working again 🤷🏽♂️
I tested the approach using terminal and typing: jupyter notebook
as suggested here. I can confirm that this works as well and there is no need to downgrade or change VS Code versions.
The process is similar:
- Open terminal and type
jupyter notebook
in terminal and copy localhost (it will also open Jupyter in browser by default but you don't need to keep running it). - Command + Shift + P
- Specify Jupyter Server for Connections
- Paste copied URL
- Command + Shift + P
- Open interactive window and select the remote kernel you specified earlier
- Select the same remote kernel also in your Jupyter session, i.e. local notebook so identical kernel is in interactive and local session. Now you should have output carried from your Jupyter notebook to your interactive window.
duplicate of https://github.com/microsoft/vscode-jupyter/issues/4573