nb_conda_kernels icon indicating copy to clipboard operation
nb_conda_kernels copied to clipboard

Environment is not getting activated

Open tomcatlingcma opened this issue 5 years ago • 1 comments

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.

tomcatlingcma avatar Aug 08 '19 12:08 tomcatlingcma

Duplicate in #145

tomcatlingcma avatar Aug 08 '19 14:08 tomcatlingcma

Closing as duplicate

mcg1969 avatar Mar 06 '24 23:03 mcg1969