microsoft / vscode-jupyter

VS Code Jupyter extension
https://marketplace.visualstudio.com/items?itemName=ms-toolsai.jupyter
MIT License
1.29k stars 292 forks source link

Support a notebook "scratch pad" and/or integrate interactive window experience for notebooks #4573

Open rchiodo opened 3 years ago

rchiodo commented 3 years ago

This is similar to gather but without having to run gather.

Sometimes I'm working on a notebook and I add some cells to try something out and I don't want to lose them, but I don't want them in my 'main' notebook.

ahmedanis03 commented 3 years ago

any updates on this?, this is a killer feature to be honest for every data scientist.

rchiodo commented 3 years ago

There was a hackathon project that implemented it but we haven't shipped that yet. It's waiting more up votes I think.

mischki commented 2 years ago

Does anyone have any updates at all?

rchiodo commented 2 years ago

This isn't on our backlog (you can check the milestone to see if we plan to implement it soon).

thehappycheese commented 2 years ago

Keen for this feature please

erikvdp commented 2 years ago

I'd love to have this feature as well!

tadz-io commented 2 years ago

would be great to have this feature. It's the only thing preventing me atm from using VSC for jupyter notebooks...

aras-y commented 2 years ago

I'd love to have this feature!

mischki commented 2 years ago

I'd love to have this feature!

philffm seems to have found a workaround, but I haven't been able to figure out how to implement the first step of getting the notebook kernel's URL in VScode. If someone could confirm the workaround it would be great.

rchiodo commented 2 years ago

The workaround is to use a 'remote' jupyter server. Essentially you start jupyter yourself on your local machine and then use that to run your kernels.

That allows you to change the kernel to an already running kernel on any notebook or interactive window.

mischki commented 2 years ago

The workaround is to use a 'remote' jupyter server. Essentially you start jupyter yourself on your local machine and then use that to run your kernels.

That allows you to change the kernel to an already running kernel on any notebook or interactive window.

Thank you. This indeed works, but I'm having to create a notebook externally and then connect both the VSCode notebook and the VSCode interactive window to that kernel. It's better than nothing, but gets cumbersome if one needs to run several notebooks at the same time (I routinely have 5-6 actively run notebooks at any given time). So the question is - how could one obtain the URL of the kernel of the notebook started within VSCode, i.e. internally? Then one could simply pass that URL on to the interactive window and voila.

rchiodo commented 2 years ago

So the question is - how could one obtain the URL of the kernel of the notebook started within VSCode, i.e. internally? Then one could simply pass that URL on to the interactive window and voila.

This isn't possible. There isn't one.

However you don't have to open the notebook outside VS code. If you set VS code to use 'remote' (localhost), just open a notebook and run it. The kernel should then appear in the list of kernels for an interactive window if you start it afterwards.

ulfaslak commented 2 years ago

NEED THIS FEATURE! ⚡️⚡️🙏

Zhivago-Sizov commented 2 years ago

@ulfaslak It looks like Jupyter: Create Interactive Window do the job. Just switch the ipykernel in the top right corner manually.

ulfaslak commented 2 years ago

@vuvalini Not in my environment. It creates and connects to a new kernel instance, not the existing one that my notebook runs on.

Timsaur commented 2 years ago

would be a sick feature to have

DonJayamanne commented 2 years ago

Blocked on https://github.com/microsoft/vscode-jupyter/issues/9517

AaronCreighton commented 1 year ago

similar idea here: https://github.com/microsoft/vscode-jupyter/issues/6765

jklen commented 10 months ago

hello,

is any progress on this? I recently switched from jupyter lab to vscode, and this feature, aka "interactive ipython console attached to the notebook", is a must have feature. This is a very frequent thing, that I need to access variables, do some temporary plots or analytics, but I do not want then in the notebook.

ChrisKInfo commented 9 months ago

Same question - any update on this - I would like to move to VS Code for Copilot, but looking for that feature:)

amunger commented 9 months ago

This hasn't yet made it into the plan and still relies on #6765, though still something that we plan to do.

Using a jupyter server created outside vs code is still a reliable workaround though https://github.com/microsoft/vscode-jupyter/issues/6484#issuecomment-1018674246

tapyu commented 9 months ago

I need this feature!

Yefee commented 8 months ago

+1 need this feature. Thanks!

Mr-Ruben commented 8 months ago

I got that working (a interactive window in VScode connected to the same kernel of the notebook) following these instructions https://stackoverflow.com/a/72599604/4752223

kernel of the notebook = a kernel running in JupyterLab server

image

Unfortunately, I was aiming to also be able to run just a notebook-selection (Shift+Enter) into that 'interactive window' (just like in Jupyterlab) but that seems not possible yet.

tapyu commented 8 months ago

@Mr-Ruben Does that work for any operating system?

ulfaslak commented 8 months ago

download

thehappycheese commented 8 months ago

Running a separate jupyter server is a non-solution.

I work with several people who continue to avoid vscode because this feature is missing. I'm also pretty keen on it.

rjavierch commented 8 months ago

This hasn't yet made it into the plan and still relies on #6765, though still something that we plan to do.

Using a jupyter server created outside vs code is still a reliable workaround though #6484 (comment)

I have followed the steps in #6484. I create a server and copy and paste the server's URL into the interactive window's interpreter. It seems to work but as soon as I close the interactive window, the kernels shut down.

This works well in ipynb files, though. I can close the jupyter notebook, connect again, and continue using the same kernel.

Is there a way to prevent the interactive window from shutting down the kernel after closing it?

DonJayamanne commented 8 months ago

Is there a way to prevent the interactive window from shutting down the kernel after closing it?

unfortunately no, this by design

abhirajD commented 8 months ago

This hasn't yet made it into the plan and still relies on #6765, though still something that we plan to do.

Using a jupyter server created outside vs code is still a reliable workaround though #6484 (comment)

@Everyone What would it take for this feature request to make it to the plan? How does the team select and prioritize external feature requests?

jaanli commented 7 months ago

+1 this would be great! For the debugger especially.

tapyu commented 7 months ago

unfortunately no, this by design

So let them change the design.

izkula commented 7 months ago

I agree this is an essential feature for switching to vscode for data analysis. I would love to see this supported!

kotarotaniguchi commented 7 months ago

+1 - please implement this feature :)

edobezabb commented 7 months ago

Repeating https://github.com/microsoft/vscode-jupyter/discussions/12162#discussioncomment-4298950 comment:

I open up a terminal (in vscode or outside) and run % jupyter console --existing and it attaches to the existing running server. I find it work fine that way.

Looks as good workaround until we have the solution implemented in the "interactive window".

Yefee commented 7 months ago

any plan on this?

Mr-Ruben commented 7 months ago

Now it is even easier* than before thanks to Jupyter PowerToys https://marketplace.visualstudio.com/items?itemName=ms-toolsai.vscode-jupyter-powertoys

* If you are connecting to a Remote Kernel

kernels

You can just locate the kernel of your notebook (local or remote) and click "create interactive window" (look carefully inside the image).

I have very few extensions, but this is a useful one.

Yefee commented 7 months ago

Now it is even easier than before thanks to

Jupyter PowerToys https://marketplace.visualstudio.com/items?itemName=ms-toolsai.vscode-jupyter-powertoys

kernels

You can just locate the kernel of your notebook (local or remote) and click "create interactive window" (look carefully inside the image).

I have very few extensions, but this is a useful one.

@Mr-Ruben How did you do that? I dont have the "create interactive window" icon.

CleanShot 2024-03-30 at 23 45 55@2x
Mr-Ruben commented 7 months ago

I guess the difference between us is that I was using a 'Remote kernel' (I'm connecting to JupyterLab). Note the Remote Kernels on my image.

thehappycheese commented 7 months ago

Remote kernel connection is not what this issue is about. Please stop pointing out that that is possible. Nobody wants to start their own kernel every time. VS Code is an IDE. We are asking for some 'integrated' in our 'development environment'

Yefee commented 6 months ago

Remote kernel connection is not what this issue is about. Please stop pointing out that that is possible. Nobody wants to start their own kernel every time. VS Code is an IDE. We are asking for some 'integrated' in our 'development environment'

Even for remote kernel, it is impossible to send code to console and execute using shortcuts like control+z now. That is annoying as well.

jaanli commented 6 months ago

This would be super helpful and is a glaring missing feature, especially for LLM-based workflows that require significant amounts of in-context examples (e.g. for chain-of-thought prompt engineering workflows). Happy to share examples if needed.

Orilio commented 5 months ago

+1 would love to see this implemented

keithdlandry commented 5 months ago

+1 I think the is more or less a must have feature for a huge group of people. I've tried to switch to VS code for my notebook work multiple times but I always end up switching back to jupyter lab soley for this functionality.

jaanli commented 4 months ago

i gave a talk at @Lightning-AI last week: slides @ https://talks.onefact.org.

i highlighted this as one of the missing features for why i couldn't recommend @microsoft 's vs code :(

demo i gave:

https://colab.research.google.com/github/onefact/loving-the-baseline/blob/main/nearest-neighbors.ipynb

danielcarlos-ifpen commented 4 months ago

Just wanted to add my 10 cents for people who are impatiently waiting for this feature, like me. When you migrate from MATLAB-based workflow to Python-based using VS Code, this honestly becomes one of the most annoying blocking points in the workflow, and things that were once very easy to verify (variables, array lengths, the value on a given index, etc.) now require one or more extra steps that sometimes make me not want to get simple information from my data.

However, for the moment, I am circumventing this problem by always adding a cell that doesn't do much (for example, just a simple debug = 1) and by putting a breakpoint on it. Then, if I need to use a terminal which has the loaded variables of the notebook, I just run this cell in debug mode. This allows me to use the Debug Console as a terminal, which is honestly very useful, especially with its ability of unfolding objects as dictionaries, another feature that some are expecting ( e.g., #1138 ). When in debug mode, you can also open DataFrames with the Data Viewer from the 'Run and Debug' tab. It is still not possible to open variables with Data Wrangler, though, but hopefully this will come with the implementation of an actual terminal designed to work with notebooks.

Orilio commented 4 months ago

However, for the moment, I am circumventing this problem by always adding a cell that doesn't do much (for example, just a simple debug = 1) and by putting a breakpoint on it. Then, if I need to use a terminal which has the loaded variables of the notebook, I just run this cell in debug mode. This allows me to use the Debug Console as a terminal, which is honestly very useful, especially with its ability of unfolding objects as dictionaries, another feature that some are expecting ( e.g., #1138 ). When in debug mode, you can also open DataFrames with the Data Viewer from the 'Run and Debug' tab. It is still not possible to open variables with Data Wrangler, though, but hopefully this will come with the implementation of an actual terminal designed to work with notebooks.

interesting workaround and although it doesn't solve most of my problems, I guess this solve some

bcalvr commented 2 months ago

Has there been any update/progress on this please? +1 to it being a feature that would greatly improve VSCode and is already in many other applications such as JupyterLab

drakesiardmw commented 1 month ago

There was a hackathon project that implemented it but we haven't shipped that yet. It's waiting more up votes I think.

How many more upvotes does this need? Can we get an update on whether there is any plan to deliver this feature?

The current state is that it's possible (as Jupyter Lab does this already) and apparently already implemented (see above comment regarding the hackathon), but not available to users.

vvatikiotis commented 1 month ago

Switched back to JupyterLab just for this. Lack of this feature is a pain. Shame, I like VSCode....