set CONDA_DEFAULT_ENV in activate script as well

pull/690/head
Min RK 2019-05-24 11:25:56 +02:00
rodzic 9bf2e13832
commit f5d05903c6
1 zmienionych plików z 8 dodań i 1 usunięć

Wyświetl plik

@ -3,9 +3,16 @@ CONDA_PROFILE="${CONDA_DIR}/etc/profile.d/conda.sh"
test -f $CONDA_PROFILE && . $CONDA_PROFILE
if [[ "${KERNEL_PYTHON_PREFIX}" != "${NB_PYTHON_PREFIX}" ]]; then
# if the kernel is a separate env, stack them
# so both are on PATH
# so both are on PATH, notebook first
conda activate ${KERNEL_PYTHON_PREFIX}
conda activate --stack ${NB_PYTHON_PREFIX}
# even though it's second on $PATH
# make sure CONDA_DEFAULT_ENV is the *kernel* env
# so that `!conda install PKG` installs in the kernel env
# where user packages are installed, not the notebook env
# which only contains UI when the two are different
export CONDA_DEFAULT_ENV="${KERNEL_PYTHON_PREFIX}"
else
conda activate ${NB_PYTHON_PREFIX}
fi