question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

No way to set Juypter Server URI programmatically

See original GitHub issue

Environment data

  • VS Code version: 1.63.2
  • Jupyter Extension version (available under the Extensions sidebar): v2021.11.1001550889
  • Python Extension version (available under the Extensions sidebar): v2021.12.1559732655
  • OS (Windows | Mac | Linux distro) and version: Ubuntu 20.04
  • Python and/or Anaconda version: 3.6.8
  • Type of virtual environment used (N/A | venv | virtualenv | conda | …): N/A
  • Jupyter server running: Local | Remote | N/A; Remote

Expected behaviour

There exist an option to set the Jupyter Server URI programmatically from another extension/shared config/etc.

Previously I believe this was supported via a config option in settings.json like :

  • "python.dataScience.jupyterServerURI": "http://localhost:8000/jupyter/"

With that option I could modify the workspace settings thus setting the URI without using the selector.

Any option to set the URI without user interaction would be greatly appreciated. Whether it be a command that can be executed and passed args, or a config option that is respected from setting.json

Actual behaviour

As far as I am aware of, nothing like this exists currently.

Even the command "jupyter.selectjupyteruri" does not allow the passing of an uri. Rather it pulls up the selector you pass to it.

Steps to reproduce:

[NOTE: Self-contained, minimal reproducing code samples are extremely helpful and will expedite addressing your issue]

Try and find a way to set the URI without the user interface.

In my particular use case, I just need to be able to set the URI to a remote jupyter server from the context of a VSCode extension. In doing so, any notebook opened would already be configured to use the remote server without user interaction.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:3
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
rchiodocommented, Feb 2, 2022

Yes it would be bad if context.secret was accessible elsewhere. Your quickest workaround may be to just implement having ‘jupyter.selectJupyterUri’ take an argument and submit a PR.

I mean it’s probably possible to change the value to something hardcoded, save off the DB with the context keys, then copy that DB overtop of the one on the running machine, but that’d only work if the URI was constant.

1reaction
rchiodocommented, Feb 1, 2022

Thanks for the suggestion. We stopped exposing the URI as a setting because of the potential for people to accidentally checkin in their server token.

But seems reasonable to allow ‘jupyter.selectjupyteruri’ to allow a URI to use.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Working with Jupyter Notebooks in Visual Studio Code
Create or open a Jupyter Notebook​​ You can create a Jupyter Notebook by running the Create: New Jupyter Notebook command from the Command...
Read more >
How to set the running file path of jupyter in VScode?
Just under the search, on the Jupyter extension, click the gear. Scroll down to "Notebook File Root". – travelingbones. Dec 22 at 17:25....
Read more >
Using JupyterHub's REST API - Read the Docs
How to create an API token. Assigning permissions to a token. Updating to admin services. Making an API request programmatically using the requests...
Read more >
Connecting Jupyter notebooks | Data Mechanics documentation
Connect a local Jupyter server​​ The Jupyter notebook server has an option to specify a gateway service in charge of running kernels on...
Read more >
How to Execute Jupyter Notebooks from GitHub
You can also use nbviewer to browse through the code of any notebook, given either GitHub username/repo, or any URL on the internet....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found