vickumar1981 / jupyter-dart-kernel

Dart Kernel for Jupyter Notebooks
MIT License
42 stars 5 forks source link

Document VS Code Setup (support for vscode) #6

Open onoe-serika opened 1 year ago

onoe-serika commented 1 year ago

Hello, can this support vscode?

vickumar1981 commented 1 year ago

@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 commented 1 year ago

@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 commented 1 year ago

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

vigilancer commented 9 months ago

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 git@github.com: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

vickumar1981 commented 8 months ago

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