3

I am having troubles with my conda installation on a cluster. It seems that i can't deactivate any of my environments. it goes so far, that i have to close my terminal because it froze.

I am working on multiple server with a common home directory, so i can access the same conda installation from different servers. Interestingly, I can deactivate the conda envs on a different server, but not on my main server, which i work most of the time.

I use conda 22.9.0

I there a way to solve this without reinstalling everything? (Can I reinstall conda itself without loosing the already set environments?)

Thanks

enter image description here

5
  • Give us some insight by putting your terminal outputs.
    – rafathasan
    Commented Oct 20, 2022 at 6:09
  • Not really sure what to put. This is why I didn't add anything. I have added a pic of what i see. Activating is not a problem, but deactivating freezes the screen Commented Oct 20, 2022 at 6:18
  • 3
    Possibly related: github.com/conda/conda/issues/11885. You shouldn't need to reinstall Conda. Instead, clean out the .bashrc (or .bash_profile) and then try rerunning conda init. Issues with conda activate or deactivate are almost always about shell initialization files, not about Conda Python package. Worst case, downgrade conda to 4.14.
    – merv
    Commented Oct 20, 2022 at 18:43
  • thanks, a simple conda init bash seems to do the trick for now. Let's see if it stays. Commented Oct 21, 2022 at 5:05
  • using powershell can be cause of this issue. Try to kill this terminal and open a cmd terminal. Then try conda deactivate.
    – EMT
    Commented Jan 24 at 15:04

1 Answer 1

8

thanks to @merv I could easily solve the problem.

Running conda init bash and restarting the terminal seems to clean something and now it works as well. I can see again my prompt and the environments are closing again.

yeroslaviz@hpcl8001:~$ conda init bash
modified      /fs/home/yeroslaviz/miniconda3/condabin/conda
modified      /fs/home/yeroslaviz/miniconda3/bin/conda
modified      /fs/home/yeroslaviz/miniconda3/bin/conda-env
no change     /fs/home/yeroslaviz/miniconda3/bin/activate
no change     /fs/home/yeroslaviz/miniconda3/bin/deactivate
no change     /fs/home/yeroslaviz/miniconda3/etc/profile.d/conda.sh
no change     /fs/home/yeroslaviz/miniconda3/etc/fish/conf.d/conda.fish
no change     /fs/home/yeroslaviz/miniconda3/shell/condabin/Conda.psm1
no change     /fs/home/yeroslaviz/miniconda3/shell/condabin/conda-hook.ps1
no change     /fs/home/yeroslaviz/miniconda3/lib/python3.7/site-packages/xontrib/conda.xsh
no change     /fs/home/yeroslaviz/miniconda3/etc/profile.d/conda.csh
no change     /fs/home/yeroslaviz/.bashrc

==> For changes to take effect, close and re-open your current shell. <==

yeroslaviz@hpcl8001:~$ exit

yeroslaviz@hpcl8001:~$ conda activate base
(base) yeroslaviz@hpcl8001:~$ 
(base) yeroslaviz@hpcl8001:~$ conda deactivate
yeroslaviz@hpcl8001:~$ 

Not the answer you're looking for? Browse other questions tagged or ask your own question.