1

I installed Conda using Anaconda3-2019.10-Linux-x86_64.sh. It works fine until today. I was able to run create new virtual env and activate it and then deactivate it as expected. Basically,

  • conda --version was fine.
  • conda create -n newenv was fine.
  • conda activate newenv was fine too.

Now, after creating an additional new env, conda refuses to activate it, i.e. the command conda activate newenv returns powerline-shell:command not found and I need to kill the terminal.

What changed ? I have updated my conda version. I'm now running conda 4.8.3 under ubuntu 18.04.4 LTS. I check that conda activate and conda deactivate only work on conda 4.6 and later versions. Hence should work here with 4.8.3.

The new env appears in the list when running conda env list.

echo $PATH is showing among other things:

  • /home/<user>/anaconda3/bin
  • /home/<user>/anaconda3/condabin

I can install package using conda install -n newenv numpy. Works fine. I can list the packages in the new env.

How come conda activate stopped working and other conda commands still work ? How can I fix it ?

After numerous trials, I fixed it the following way:

  1. remove powerline config from .bashrc file

    function _update_ps1() { PS1=$(powerline-shell $?) }

    if [[ $TERM != linux && ! $PROMPT_COMMAND =~ _update_ps1 ]]; then PROMPT_COMMAND="_update_ps1; $PROMPT_COMMAND" fi

  2. pip install powerline-shell

  3. Restore the config lines of powerline-shell in .bashrc

I'm not sure I fully understand the origin of the issue. In my opinion, the update of conda broke the dependency to powerline-shell package. Removing the lines from the .bashrc config allows me to understand that the problem is only linked to powershell and not to a deeper conda or commandline issue. Hence the idea to reinstall powershell package.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.