-
Notifications
You must be signed in to change notification settings - Fork 325
Kernel specs with custom env variables not listed in list of kernel specs #7719
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@IanMatthewHuff weird it works for you, this doesn't work for me in stable or insiders. |
@DonJayamanne Just took a look. In my setup I used a conda env to install kernelspecs globally not locally in the env folder. That was fixed for me a release or two ago, and has been ok since then. |
This is working for me now. |
Anything to verify here? |
If this should be verified with the original steps, how do I do that? |
Kernelspecs normally look like so (you can find yours with {
"spec": {
"argv": [
"python",
"-m",
"ipykernel_launcher",
"-f",
"{connection_file}"
],
"env": {},
"display_name": "Python 3 (ipykernel)",
"language": "python",
"interrupt_mode": "signal",
"metadata": {
"debugger": true
}
}
} For one that matches a specific interpreter, the argv[0] would be the path to the interpreter: {
"spec": {
"argv": [
"c:\\users\\aku91\\miniconda3\\envs\\foobar\\python.exe",
"-m",
"ipykernel_launcher",
"-f",
"{connection_file}"
],
"env": {},
"display_name": "MY CUSTOM FOOBAR",
"language": "python",
"interrupt_mode": "signal",
"metadata": {
"debugger": true
}
}
}
That shouldn't show up though (at least not yet) as it doesn't have an 'env' entry. To add an 'env' entry, just do this: {
"spec": {
"argv": [
"c:\\users\\aku91\\miniconda3\\envs\\foobar\\python.exe",
"-m",
"ipykernel_launcher",
"-f",
"{connection_file}"
],
"env": {},
"display_name": "MY CUSTOM FOOBAR",
"language": "python",
"interrupt_mode": "signal",
"metadata": {
"debugger": true
}
"env": {
"FOOBAR": 1
}
}
}
|
Sorry, where do I put this JSON? |
If you type
|
I added it to one of my existing kernelspecs, then I try to access the var like |
One of your existing kernelspecs may not be using the kernelspec to launch the kernel. I guess it depends. But yes that's how you'd test it with a custom kernelspec. |
Why would that be? How do I find one that uses the kernelspec? |
Here's my list: You can see that I have a global python kernel and two other kernelspecs that map to the same interpreter. The two other ones are listed as It might be you edited a kernelspec that had the same name as an interpreter and so you started the interpreter instead of your custom kernelspec. You need to give it a unique name for it to show up as a different entry. |
Verified |
abc
xyz
The text was updated successfully, but these errors were encountered: