Reputation: 133
I want to execute a local script on a remote Ubuntu machine - I have my local script setup like this:
ssh -i ~/my.pem remote_machine 'bash -s' < ./install.sh
and, in ./install.sh, I have multiple lines, some of which is reproduced here:
source activate mySrc
pip install <install from a pypri repo>
The error i get is
`bash: line 5: pip: command not found
I have confirmed that pip is installed on the remote server. But, I still get this error. Can you suggest why this could be happening?
Upvotes: 1
Views: 52
Reputation: 133
Thanks to @stovfl. The problem is that when the ssh connection was established, the environment PATH variable was not getting set. Therefore, it did not have the information about the conda environment where pip was installed.
I just solved it by explicitly setting the path to where pip was installed!
StackExchange UNIX & LINUX: How to guarantee availability of $BASH_ENV
Upvotes: 3