jupyter-dart-kernel icon indicating copy to clipboard operation
jupyter-dart-kernel copied to clipboard

Document VS Code Setup (support for vscode)

Open onoe-serika opened this issue 2 years ago • 5 comments
trafficstars

Hello, can this support vscode?

onoe-serika avatar Dec 10 '22 11:12 onoe-serika

@onoe-serika , not sure. are there instructions on how to setup a jupyter kernel w/ vs code? i can try testing it out.

thanks.

vickumar1981 avatar Dec 10 '22 15:12 vickumar1981

@onoe-serika : https://devinschumacher.com/how-to-setup-jupyter-notebook-virtual-environment-vs-code-kernels/

it looks like vscode mainly supports the ipykernel (i.e., Python), but there is an option to connect vscode to your local jupyter server.

Not sure, but this might require writing a VSCode extension or something along those lines.

vickumar1981 avatar Dec 10 '22 15:12 vickumar1981

I'm open to ideas/suggestions on how best to approach this.

vickumar1981 avatar Dec 15 '22 18:12 vickumar1981

VSCode support is already there.

Here is brief overview what needs to be done to run dart in jupyter notebook in vs code:

I could be missing something and YMMV but here is basic idea.

in terminal:

# install conda, I'm using miniconda
brew install miniconda

# setup env to install kernel into correct environment
eval "$(conda "shell.$(basename "${SHELL}")" hook)"

# install kernel
cd /tmp && git clone [email protected]:vickumar1981/jupyter-dart-kernel.git && pip3 install -e ./jupyter-dart-kernel/

in vscode:

Create: New Jupyter Notebook

In new notebook click 'Select Kernel' -> Select Another Kernel... -> Jupyter Kernel...' and choose 'Dart'. Screenshot 2024-02-23 at 19 57 38 Screenshot 2024-02-23 at 19 57 44 Screenshot 2024-02-23 at 19 57 50

Here you can see how it runs with and without errors:

Screenshot 2024-02-23 at 20 08 58

Notes:

If you keep getting errors 'The kernel failed to start due to the missing module 'jupyterdartkernel'. Consider installing this module', then check logs to find out which python environment is used and install this module into that environment.

Screenshot 2024-02-23 at 20 07 19

Screenshot 2024-02-23 at 20 02 38

vigilancer avatar Feb 23 '24 16:02 vigilancer

@vigilancer 👍 i'm going to change this issue to "Document VS Code Setup".

vickumar1981 avatar Mar 31 '24 01:03 vickumar1981