Why I can't do 'conda activate <env>' in JupyterLab?

Hi all,

I am using Jupyter lab, I can use conda command such as:

conda list
conda info --envs
pip list

but I cannot use conda activate <env-name> even if I have tried conda init

This is what shows up when I type conda init
no change /home/browni/.julia/conda/3/condabin/conda
no change /home/browni/.julia/conda/3/bin/conda
no change /home/browni/.julia/conda/3/bin/conda-env
no change /home/browni/.julia/conda/3/bin/activate
no change /home/browni/.julia/conda/3/bin/deactivate
no change /home/browni/.julia/conda/3/etc/profile.d/conda.sh
no change /home/browni/.julia/conda/3/etc/fish/conf.d/conda.fish
no change /home/browni/.julia/conda/3/shell/condabin/Conda.psm1
no change /home/browni/.julia/conda/3/shell/condabin/conda-hook.ps1
no change /home/browni/.julia/conda/3/lib/python3.9/site-packages/xontrib/conda.xsh
no change /home/browni/.julia/conda/3/etc/profile.d/conda.csh
no change /home/browni/.bashrc
No action taken.

Note: you may need to restart the kernel to use updated packages.

Then I try to activate the environment:

conda activate lasthrim_env

CommandNotFoundError: Your shell has not been properly configured to use ‘conda activate’.
To initialize your shell, run

** $ conda init <SHELL_NAME>**

Currently supported shells are:
** - bash**
** - fish**
** - tcsh**
** - xonsh**
** - zsh**
** - powershell**

See ‘conda init --help’ for more information and options.

IMPORTANT: You may need to close and restart your shell after running ‘conda init’.

Note: you may need to restart the kernel to use updated packages.

I have restart the notebook, adjust the .bashrc so when I shutdown and restart the conda will be activated.

This conda initialize already in my .bashrc:

# >>> conda initialize >>>
# !! Contents within this block are managed by 'conda init' !!
__conda_setup="$('/home/browni/.julia/conda/3/bin/conda' 'shell.bash' 'hook' 2> /dev/null)"
if [ $? -eq 0 ]; then
    eval "$__conda_setup"
else
    if [ -f "/home/browni/.julia/conda/3/etc/profile.d/conda.sh" ]; then
        . "/home/browni/.julia/conda/3/etc/profile.d/conda.sh"
    else
        export PATH="/home/browni/.julia/conda/3/bin:$PATH"
    fi
fi
unset __conda_setup
# <<< conda initialize <<<


Hi, have you found the solution? I am having the similar issue.

After billions of years there is a question…

I manage to work it out, but maybe will be different due to I am using a Linux OS…

So

  1. First open terminal then type
source /home/browni/.julia/conda/3/bin/activate 
		
conda activate lasthrim_env

conda install -c conda-forge matplotlib-venn

lasthrim_env is the name of the environment.

The module will be installed automatically and can be used directly from JupyterLab or if it is not working, try to restart the notebook.

why source /home/browni/.julia/conda/3/bin/activate ?

It is because I want to use Python’ modules for Julia, I am using Jupyter Notebook with Julia kernel / IJulia…