nb_conda_kernels
nb_conda_kernels copied to clipboard
Environment is not getting activated
Issue
Conda environments are not being activated before the kernel is started.
Explanation
Let's say I am running jupyterlab from within <notebook_environment> and creating a notebook or console session with a kernel from <my_environment>.
The kernel runs in the correct environment, but 'conda activate <my_environment>' doesn't seem to be applied before the kernel is started.
I suspect this might be a jupyterlab issue rather than a problem with nb_conda_kernels, as running
python -m nb_conda_kernels.runner /home/ubuntu/miniconda <my_environment> conda info
from within <notebook_environment> does behave as I expect. However when I start a notebook or console in jupyterlab with the <my_environment> kernel and run
os.popen('conda info').read()
os.environ
System.getenv()
(R)
or similar, I get back info for <notebook_environment> rather than <my_environment>. The kernel is definitely pointing at the right executable because I do see the correct libraries etc.
Environment
<notebook_environment> jupyterlab 1.0.4 nb_conda_kernels 2.2.2 conda 4.6 (same behaviour in 4.7)
<my_environment> R and Python kernels give the same result.
Duplicate in #145
Closing as duplicate