How to specify a default Jupyter kernel via configuration? #13032
-
I am trying to set a kernel via some kind of version-controllable configuration (in a devcontainer, if that matters), so I don't have to respecify kernels every time I rebuild (or when a new user spins up the a container). Here is my most promising lead so far (hence why I'm asking here): In the docs (see here), it says:
Is there a way to control that association so that a specified kernel will work automatically? I'd like to set it up in my devcontainer, and have it just work. |
Beta Was this translation helpful? Give feedback.
Replies: 6 comments
-
I have the same problem. |
Beta Was this translation helpful? Give feedback.
-
update: |
Beta Was this translation helpful? Give feedback.
-
I'm also trying to figure this out - I was hoping that at least if I override the language version in the metadata in the notebooks, it would auto-select that version, but it still prompts for an interpreter the first time. I filed this issue asking for a project-wide configuration: #13641 |
Beta Was this translation helpful? Give feedback.
-
I see a similar discussion here: Add a default kernel option to settings.json microsoft/vscode#130946 |
Beta Was this translation helpful? Give feedback.
-
As a workaround, putting all Python environments except a single one in the setting Intellisense nicely suggests all the interpreter paths in settings.json, but you might end up with something like: {
"jupyter.kernels.excludePythonEnvironments": [
"~/.pyenv/versions/3.10.10/bin/python",
"/opt/homebrew/bin/python3.10",
"~/.pyenv/versions/mambaforge/bin/python",
"~/.pyenv/versions/3.10.2/bin/python",
"~/.pyenv/versions/3.11.2/bin/python",
"/opt/homebrew/bin/python3",
"~/.pyenv/versions/3.11.7/bin/python",
"/opt/homebrew/bin/python3.12",
"~/.pyenv/versions/3.7.16/bin/python",
"~/.pyenv/versions/3.8.16/bin/python",
"~/.pyenv/versions/3.9.16/bin/python",
"/opt/homebrew/bin/python3.9",
"/usr/bin/python3"
],
} |
Beta Was this translation helpful? Give feedback.
-
Please see solution here microsoft/vscode#130946 (comment) |
Beta Was this translation helpful? Give feedback.
Please see solution here microsoft/vscode#130946 (comment)