anaconda / nb_conda_kernels

Package for managing conda environment-based kernels inside of Jupyter
BSD 3-Clause "New" or "Revised" License
601 stars 70 forks source link

Environment is not getting activated #144

Closed tomcatlingcma closed 8 months ago

tomcatlingcma commented 5 years ago

Issue

Conda environments are not being activated before the kernel is started.

Explanation

Let's say I am running jupyterlab from within and creating a notebook or console session with a kernel from .

The kernel runs in the correct environment, but 'conda activate ' 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 does behave as I expect. However when I start a notebook or console in jupyterlab with the kernel and run

os.popen('conda info').read()

os.environ

System.getenv() (R)

or similar, I get back info for rather than . The kernel is definitely pointing at the right executable because I do see the correct libraries etc.

Environment

jupyterlab 1.0.4 nb_conda_kernels 2.2.2 conda 4.6 (same behaviour in 4.7) R and Python kernels give the same result.
tomcatlingcma commented 5 years ago

Duplicate in #145

mcg1969 commented 8 months ago

Closing as duplicate