I would like to run a local python script remotely but activate the proper environment within the remote machine first. For example, if running locally I would do:
source activate myenv python myscript.py
I thought I could do this using ssh like so:
ssh user@host "source activate myenv && python" < ./myscript.py
However, this doesn't seem to work. It produces the error message:
bash: activate: No such file or directory
What's the best way to do something like this?