microsoft / vscode-jupyter

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

Can't execute k3d widget notebook #13131

Closed joyceerhl closed 1 year ago

joyceerhl commented 1 year ago

Testing microsoft/vscode#177719

  1. Open https://github.com/microsoft/vscode-jupyter/blob/main/src/test/datascience/widgets/notebooks/k3d_widgets.ipynb
  2. Install k3d
  3. Run first cell
  4. :bug: Cell never completes, no errors in output or dev tools
image
DonJayamanne commented 1 year ago

Please could you enable logging as follows:

DonJayamanne commented 1 year ago

Works for me, please do share the verbose logs

joyceerhl commented 1 year ago

Still repros for me, sent you logs on Slack @DonJayamanne

DonJayamanne commented 1 year ago

@joyceerhl

Ensure you install python -m pip install jupyter notebook into the same python kernel environment and launch jupyter from there using python -m jupyter jupyter notebook and try it ouc.

joyceerhl commented 1 year ago

So I went and split out all the lines in that notebook, and it looks like this succeeds:

https://insiders.vscode.dev/github.com/microsoft/vscode-jupyter/blob/adfc442a2178eff34d9cdc5aa049acecfbc9e8a9/src/test/datascience/widgets/notebooks/k3d_widgets.ipynb#C4:L1-L9

But executing this line never returns

https://insiders.vscode.dev/github.com/microsoft/vscode-jupyter/blob/adfc442a2178eff34d9cdc5aa049acecfbc9e8a9/src/test/datascience/widgets/notebooks/k3d_widgets.ipynb#C4:L11

DonJayamanne commented 1 year ago

Thanks, but that doesn't help, as I have no idea what that library does. Please could you try https://github.com/microsoft/vscode-jupyter/issues/13131#issuecomment-1480149478

joyceerhl commented 1 year ago

Tried with Python 3.10 from the Windows store, also didn't work. No errors in dev tools or Jupyter console. This notebook runs in the selected Python environment as confirmed with import sys; print(sys.executable)

joyceerhl commented 1 year ago

Weirdly, if I run python3 -m pip install jupyter notebook from the CLI, I get a message saying that all packages are already installed, and if I rerun the k3d notebook, the cell still fails to complete. But if I run import sys; !{sys.executable} -m pip install jupyter notebook in a notebook cell, then the cell completes. So I think the k3d library and/or the ipywidgets library have not declared a dependency on the notebook submodule that is really required to execute that library's code. I don't think this is a Jupyter extension problem at all, probably something that needs fixing in k3d and/or ipywidgets.

DonJayamanne commented 1 year ago

robably something that needs fixing in k3d and/or ipywidgets.

Great, thanks for digging into this, will close this issue.

FYI: Instead of using python3 -m pip install, you need to activate the python environment you are working on and then run