1

I want to run a process (a python program) on a remote machine. I have both Canopy and Anaconda installed.

After I SSH into the remote machine, if I type 'python', I get the python prompt - the Canopy version.

If I type 'screen', hit 'enter', then type 'python', I get the python prompt - the Anaconda version.

I want to use the Canopy version when I'm in 'screen'. How can I do so?

3
  • find full path to Canony python which python and later use this full path in screen. Commented Nov 2, 2016 at 3:35
  • Thank you, but this does not solve the problem. I type 'which python', and I get the path. If I type 'screen /path/to/Canopy', then I just get an active python session using Canopy. I would like to use my Canopy version to run a separate python program. I would like to type 'python program.py' and have it run from the Canopy version. Commented Nov 2, 2016 at 3:41
  • I was thinking about /path/to/Canopy/python or /path/to/Canopy/python script.py but I see you found this solution :). Maybe somewhere in screen configuration (or Bash configuration .bashrc) you could set alias python=/path/to/Canopy/python or something similar. Commented Nov 2, 2016 at 4:19

2 Answers 2

2

Solved! Here's how:

1) In terminal, after SSHing into the remote machine, type 'which python' (thanks @furas!). This gives path/to/Canopy/python

2) In terminal, type 'screen path/to/Canopy/python program.py' to run the desired program (called program.py) in the Canopy version of python.

Sign up to request clarification or add additional context in comments.

Comments

2

To get the same environment with screen that you got when you logged in, create a .screenrc file in your home directory or add to an existing one, with a line

shell -/bin/bash

Exit out of all other screen sessions so that screen -ls shows nothing.

Restart screen by just typing screen and see if that fixes it.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.