thatsnotmyname71
thatsnotmyname71

Reputation: 79

How to run a local conda environment through an ssh connection?

I'm trying to run a model made using the fastai library on my home machine, but have to use my university facilities to run it. I have made a conda environment on my local machine with the required packages:

conda env create -f environment.yml #creates conda env called convml_tt
conda activate convml_tt

then connected to my uni and then their computing facility by ssh:

ssh [email protected]
ssh [email protected]

However, when I have connected I can no longer find the conda environment I created locally-in fact conda is no longer found:

conda activate convml_tt

But I get the error:

-bash: conda: command not found

(it is not installed on the university accounts). I am new to this, is there something I'm overlooking?

I have done all of this in the same terminal session, could that be part of the problem?

When I have connected to the facilities I should be able to activate the conda environment and run my model from there:

conda activate convml_tt

Upvotes: 0

Views: 5791

Answers (2)

Recently I went through the same problem. I solved it using the screen command on Linux. If screen is not available in the remote machine it needs to be installed

sudo apt-get install screen 

How screen is used can be found in this blog 1

Once inside screen you will see that the conda commands can be accessed

Upvotes: -1

MegaEmailman
MegaEmailman

Reputation: 545

When you ssh to another device, you're now using that system's filesystem. But, there is a way to use the files on your local system on a remote system. I think it follows this syntax, assuming your device is called local, the target device is uni, and replacing user on both with the right username.

$ user@local:/path/to/program user@uni:/path/to/target

But I'm not positive that would work. Your best bet would be to either install conda and the dependencies on the uni device if possible, or move the script from the uni computer to your local device.

Upvotes: 2

Related Questions