Skip to content

Your shell has not been properly configured to use 'conda activate'. #10142

@nickhir

Description

@nickhir

Hi,
I am using conda 4.8.3.

I know that the issue from my title was addressed previously, and the commonly used work around source activate env also always did the trick for me.

However, now I am working with a python package that uses subprocesss function to activate a special conda eniroment.
This is when the error appers (Your shell has not been properly configured to use 'conda activate'.).
I manually changed the code to source activate instead of conda activate, but then I realized, that throughout the python package, the conda activate syntax is used very often, so it would be very tedious to manually change that all.

So I am asking, if there is a possibility to use conda activate instead of conda source inside the subprocess.

I am using a virutal machin that runs CentOS 7. When I log into the VM via ssh, I first have to source .bashrc to use conda.
My .bashrc file looks something like this:

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

I changed it according to the instructions here.

Any help is much appreciated!

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    locked[bot] locked due to inactivitystale[bot] marked as stale due to inactivitystale::closed[bot] closed after being marked as stale

    Type

    No type

    Projects

    Status

    🏁 Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions