vscode-jupyter: Local vs Remote is not obvious
Applies To
- Notebooks (.ipynb files)
- Interactive Window and/or Cell Scripts (.py files with #%% markers)
What happened?
Hi bros,
I got a issue, steps to reproduce as below:
- Install jupyterlab as tutorial https://research.google.com/colaboratory/local-runtimes.html#:~:text=In Colaboratory%2C click the "Connect,connected to your local runtime.
- Copy uri after starting jupyter server (http://localhost:8888/?token=a96d38b9077b2c7cfd05d4e255286febcb4bbaf0c5f86f27)
- Install Jupyter extension on vscode
- Connect colab runtime to local jupyter server:
- Click connect https://gyazo.com/dcd8e4636361213a24dc56e1481efacf
- Paste uri link that copied https://gyazo.com/53c9edd93f92abbb48fcc39847f21016
- Connect vscode to local jupyter server:
- Open vscode -> Ctrl + Shift + P -> Jupyter: Specify Jupyter Server for Connections -> Existing -> paste uri link that copied
- URL (http://localhost:8888/?token=a96d38b9077b2c7cfd05d4e255286febcb4bbaf0c5f86f27)
Result: Colab connect runtime to local jupyter server successfully. Vscode can’t connect local jupyter server.
Thanks in advanced for your help!
VS Code Version
1.68.1(user setup)
Jupyter Extension Version
v2022.6.1001631011
Jupyter logs
info 22:43:52.812: Creating server with url : http://localhost:8888/
info 22:43:53.3: Checking for server existence.
info 22:43:53.8: Checking for server usability.
info 22:43:53.8: Starting notebook server.
info 22:43:53.9: Connecting to server
info 22:43:53.11: Connecting to process server
info 22:43:53.11: Connecting server kernel http://localhost:8888/
Connecting to Jupyter server at http://localhost:8888/
info 22:43:53.11: Creating server with url : http://localhost:8888/
info 22:43:53.16: Connection complete server
info 22:43:53.18: Server started.
info 22:43:53.18: Creating server with url : http://localhost:8888/
info 22:43:53.169: Creating server with url : http://localhost:8888/
info 22:44:15.867: Loading webview. View is notset
info 22:44:15.869: Loading web view...
info 22:44:15.870: Webview panel created.
info 22:44:16.143: Web view react rendered
Jupyter server logs (Window cmd)
jupyter notebook --NotebookApp.allow_origin='https://colab.research.google.com' --port=8888 --NotebookApp.port_retries=0
jupyter_http_over_ws extension initialized. Listening on /http_over_websocket
[W 2022-06-22 21:49:53.045 LabApp] 'allow_origin' has moved from NotebookApp to ServerApp. This config will be passed to ServerApp. Be sure to update your config before our next release.
[W 2022-06-22 21:49:53.045 LabApp] 'port' has moved from NotebookApp to ServerApp. This config will be passed to ServerApp. Be sure to update your config before our next release.
[W 2022-06-22 21:49:53.045 LabApp] 'port_retries' has moved from NotebookApp to ServerApp. This config will be passed to ServerApp. Be sure to update your config before our next release.
[W 2022-06-22 21:49:53.045 LabApp] 'port_retries' has moved from NotebookApp to ServerApp. This config will be passed to ServerApp. Be sure to update your config before our next release.
[I 2022-06-22 21:49:53.045 LabApp] JupyterLab extension loaded from C:\Users\MSI GAMING\AppData\Local\Programs\Python\Python38\lib\site-packages\jupyterlab
[I 2022-06-22 21:49:53.045 LabApp] JupyterLab application directory is C:\Users\MSI GAMING\AppData\Local\Programs\Python\Python38\share\jupyter\lab
[I 21:49:53.045 NotebookApp] Serving notebooks from local directory: C:\Users\MSI GAMING\.jupyter
[I 21:49:53.045 NotebookApp] Jupyter Notebook 6.4.12 is running at:
[I 21:49:53.045 NotebookApp] http://localhost:8888/?token=0c35085c94c0f1bf98975d9fe8ecdf9662f5a808f5f487da
[I 21:49:53.045 NotebookApp] or http://127.0.0.1:8888/?token=0c35085c94c0f1bf98975d9fe8ecdf9662f5a808f5f487da
[I 21:49:53.045 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[C 21:49:53.092 NotebookApp]
To access the notebook, open this file in a browser:
file:///C:/Users/MSI%20GAMING/AppData/Roaming/jupyter/runtime/nbserver-8248-open.html
Or copy and paste one of these URLs:
http://localhost:8888/?token=0c35085c94c0f1bf98975d9fe8ecdf9662f5a808f5f487da
or http://127.0.0.1:8888/?token=0c35085c94c0f1bf98975d9fe8ecdf9662f5a808f5f487da
[W 21:50:07.022 NotebookApp] Forbidden
[W 21:50:07.022 NotebookApp] 403 GET /api/kernels?1655909407020 (127.0.0.1) 1.000000ms referer=None
[W 21:50:19.775 NotebookApp] Forbidden
[W 21:50:19.776 NotebookApp] 403 GET /api/kernelspecs?1655909419773 (127.0.0.1) 1.010000ms referer=None
[W 21:50:36.673 NotebookApp] Forbidden
[W 21:50:39.017 NotebookApp] 403 GET /api/sessions?1655909436673 (127.0.0.1) 2344.740000ms referer=None
Coding Language and Runtime Version
Python 3.8.8 64-bit
Language Extension Version (if applicable)
v2022.8.0
Anaconda Version (if applicable)
Pip 22.1.2 instead
Running Jupyter locally or remotely?
Local
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 15 (9 by maintainers)
#10435 should address this problem.
The general problem of ‘local’ vs ‘remote’ not being clear is something on our radar though. Some ideas are here: https://github.com/microsoft/vscode-jupyter/issues/10363 https://github.com/microsoft/vscode-jupyter/issues/10435
403 on the server is expected. There are requests that are being made without the token. That’s actually this issue here: https://github.com/microsoft/vscode-jupyter/issues/9801
The second kernel in that list is your remote kernel. The one called ‘Python 3 (ipykernel)’
Sorry I meant this UI in VS code:
That is where your remote kernels would show up. They should be under the ‘Remote Jupyter Kernels’ list. This is what I get for my own machine:
The confusion might be that we also list ‘local’ kernels in this list too. Where ‘local’ kernels are kernels creatable from a local python environment.
Thanks for the issue.
Which URL did you specify in VS code? It was unclear which URL you’re pasting from your description.
It should be this one:
http://localhost:8888/?token=0c35085c94c0f1bf98975d9fe8ecdf9662f5a808f5f487da
.If that’s the one, can you include the text of the ‘jupyter’ output tab: