microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
162.68k stars 28.69k forks source link

Support Jupyter Notebook Interactive Computing paradigm #34739

Open FuriouslyCurious opened 7 years ago

FuriouslyCurious commented 7 years ago

Around 500,000 VSCode users have been relying on Don Jayamanne has "vscodeJupyter" extension to connect to Jupyter Notebooks and execute code in an interactive environment. (https://github.com/DonJayamanne/vscodeJupyter)

With rapid continuing growth of Python, Data Science, and Deep Learning communities, Jupyter Notebooks and interactive computing need to be promoted to a first class citizen of VS Code, rather than being an extension developed by a volunteer.

Please refer to Atom + Hydrogen integration, and upcoming JupyerLab projects for ideas on how to integrate Notebooks inside Visual Studio Code.

Thank you!

MikhailArkhipov commented 6 years ago

Related https://github.com/Microsoft/vscode/issues/39492 @DonJayamanne now works for Microsoft BTW :-)

FuriouslyCurious commented 6 years ago

That's awesome @MikhailArkhipov and congratulations @DonJayamanne

We hope to see more amazing REPL, Interactive Computing, and Pythonic things from vsCode now.

domschl commented 6 years ago

See: #3220

KhurrumMahmood commented 6 years ago

Thinking about it a little, I believe the goals should be:

Somewhat unrelated: There are people working on improving Data Science dev workflows by making it possible to use R and Python together in a single IDE. If that were done well, it would be a big win!

Obviously, I just assume that this is 100% worth doing, and MS should dedicate a whole team to this! ;)

yoDon commented 6 years ago

@nojvek also has a repo with VS Code support for converting between .py and .ipynb on the fly

https://github.com/nojvek/vscode-ipynb-py-converter

jflam commented 6 years ago

I had some students at ICL build a prototype of this idea - here's their plugin: https://marketplace.visualstudio.com/items?itemName=neuron.neuron-IPE

Feedback welcome!

jamescasbon commented 6 years ago

I agree that first class notebook support would be massive, and I looked into adding it with existing extension points. However, I don't think its possible.

Motivation: many data scientists use ipython notebook as remote execution environment. However, using the notebook separate to existing ide introduces friction when trying to do the most obvious tasks (eg moving a function prototyped in a notebook into library code). It also means using a separate editor/debugger setup. Currently, jupyter is adding more and more ide features - but first class support for notebooks from an ide would be a lot better.

Suggestion, we need an vs code extension that can:

There is support for both of these individually via plugins. With the following drawbacks:

[1] is done via virtual documents or webviews, I believe neither is capable of presenting an editable view of the notebook. I looked into the filesystemprovider extension point. Using this it would be possible to transform the raw json notebook into a reasonable looking editable file with interleaved input and output. It could then use the code lens to present actions for each cell. However, this still doesn't quite do enough: the output cells can contain html (eg inline images) and I don't see a way of rendering inline html in a source document.

[2] executing the code and putting in a virtual document is already working well in other plugins. Therefore, this part should be simple enough given support for [1].

See also #41775

gramster commented 5 years ago

Note that there is an interactive experience in the Python extension now which includes import/export to .ipynb.

https://visualstudiomagazine.com/articles/2019/02/04/vs-code-python.aspx

xgdgsc commented 5 years ago

Importing / exporting feels weired, I don' t want another file.

stonebig commented 5 years ago

I did some experience, and on my win10 pc, Jupyter seems about 2 times slower at first try when used from vscode ... is it possible/normal ?

from vscode image

from a jupyter notebokk, the same code image

.

haberdashPI commented 4 years ago

Not sure if this is the right place to comment, or if this should be a new issue:

Python is not the only language Jupyter was intended for: Julia and R are both first class citizens of the framework: (ju)lia-(pyt)hon-(r). There are vscode extensions for both R and Julia. Ultimately it would be awesome if the support being added for Jupyter could have hooks so these extensions can also leverage notebooks.

ejazr83 commented 4 years ago

I would like to expan on the above feature request to allow use of remote development feature of VScode when using remote Jupyter notebooks

Currently, to be able to execute remote Jupyter notebooks in VSCode, you need to have the Python runtime installed on your local machine. If VSCode could use the remote dev features, then other runtimes like R, Julia etc could run in the VSCode context as well.

To get the same benefits of remote VS Code development such as not requiring to install Python runtime, the Python Jupter remote execution should be able to run similar to a remote VS Code development environment.

Currently this works when you SSH to a box but it would be helpful if this can also be initiated when a remote Jupyter notebook is connected to so that the cells are run remotely rather than in local runtime

This will effectively make VS code use the remote runtime for the Jupyter notebooks rather than the local runtime removing the need to have Python installed locally for this use case.

alekseiAlefirov commented 4 years ago

I would like to agree with that Notebooks should not be directly associated with programming in Python in VS Code. Considering that the community contributes a lot in creating different language kernels for Jupyter, it seems natural to have this awesome Jupyter front-end, that now resides in the Python extension, extracted. It would be really great to have a generic mechanism to provide possibility to write Notebooks in any programming language in VS Code.

gramster commented 4 years ago

See https://github.com/microsoft/vscode/issues/84293