This raises the question of handling the root environment.
If I go back to the use case, I activate the voila environment. I run the voilà command on a notebook that use the root environment. This means the code won't be executed in a properly activated root environment as it does not use the _RUNNERCOMMAND.
So should I patch the code, to add the runner on the root environment kernelspec installation.
This raises the question of handling the root environment. If I go back to the use case, I activate the
voila
environment. I run the voilà command on a notebook that use the root environment. This means the code won't be executed in a properly activated root environment as it does not use the _RUNNERCOMMAND. So should I patch the code, to add the runner on the root environment kernelspec installation._Originally posted by @fcollonval in https://github.com/Anaconda-Platform/nb_conda_kernels/pull/172#issuecomment-688425933_
In the exported kernelspec there:
https://github.com/Anaconda-Platform/nb_conda_kernels/blob/e4481a1878623542a33e0e3adad4aba689bc808c/nb_conda_kernels/manager.py#L251-L252
RUNNER_COMMAND
should be in all kernel specs as thesys.prefix
using those kernel specifications may not be the one of the notebook/jupyterlab server.Back to the use case, if I run voila on a notebook using the root environment kernel, the commands stack will be:
=> So the kernel will be executed with the root environment python. But the root environment will not be activated. So there may be inconsistency.
As proof from my computer, here is the content of $HOME/.local/share/jupyter/kernels/
conda-root-py/kernel.json
:and the one for $HOME/.local/share/jupyter/kernels/
conda-env-voila-py/kernel.json
:_Originally posted by @fcollonval in https://github.com/Anaconda-Platform/nb_conda_kernels/pull/172#issuecomment-689375089_
And actually, perhaps
nb_conda_kernels.runner
could also be modified not to re-activate if you're already in the correct environment._Originally posted by @mcg1969 in https://github.com/Anaconda-Platform/nb_conda_kernels/pull/172#issuecomment-689555206_