2

I would like to ssh into a remote server and change the conda environment - conda won't let me do that.

Either the conda command is not found and if I explicitely give the path to conda or add the path manually, it wants me too re-initialize the shell with conda init bash. Re-initialization of course does not change the error message. What can I do to use conda via ssh. (Doing the steps by hand does not lead to an error).

sshpass -p 'passwort' ssh root@999.999.999.999 "export PATH='/path/to/anaconda3/bin:$PATH'; conda activate main"
# yields: 
#CommandNotFoundError: Your shell has not been properly configured to use 'conda activate'.
#To initialize your shell, run $ conda init <SHELL_NAME>
#Although it is working very well when manually ssh-ing to the remote server

sshpass -p 'passwort' ssh root@999.999.999.999 "/path/to/anaconda3/bin/conda activate main"
# Same error

sshpass -p 'passwort' ssh root@999.999.999.999 "conda activate main"
# bash: conda: command not found

There is a similiar question python - Conda command not found - Stack Overflow but it does not cover the problem of re-initialization

Uwe.Schneider
  • 1,112
  • 1
  • 15
  • 28

0 Answers0