In [5]:
import spur

try:
    shell = spur.SshShell(hostname="localhost", \
                          username="webofthink", password="joyan1029", \
                         missing_host_key=spur.ssh.MissingHostKey.accept)
    
    with shell:
        #result = shell.run("sh", "-c", "python ./tf-hpo/src/cnn_layer2_multi.py -h")
        process = shell.spawn("sh", "-c", "echo hello")
        result = process.wait_for_result()
        print result.output
except spur.ssh.ConnectionError as error:
    print error.original_traceback
    raise



TypeErrorTraceback (most recent call last)
<ipython-input-5-8e5642919f09> in <module>()
      6     with shell:
      7         #result = shell.run("sh", "-c", "python ./tf-hpo/src/cnn_layer2_multi.py -h")
----> 8         process = shell.spawn("sh", "-c", "echo hello")
      9         result = process.wait_for_result()
     10         print result.output

/home/adsl/anaconda2/lib/python2.7/site-packages/spur/ssh.pyc in spawn(self, command, *args, **kwargs)
    169         use_pty = kwargs.pop("use_pty", False)
    170         encoding = kwargs.pop("encoding", None)
--> 171         command_in_cwd = self._shell_type.generate_run_command(command, *args, store_pid=store_pid, **kwargs)
    172         try:
    173             channel = self._get_ssh_transport().open_session()

TypeError: generate_run_command() got multiple values for keyword argument 'store_pid'

In [6]:
%run shell_control.py



TypeErrorTraceback (most recent call last)
/home/webofthink/tf-hpo/src/shell_control.py in <module>()
     20 
     21 if __name__ == "__main__":
---> 22     connect_shell()

/home/webofthink/tf-hpo/src/shell_control.py in connect_shell()
     12         with shell:
     13             #result = shell.run("sh", "-c", "python ./tf-hpo/src/cnn_layer2_multi.py -h")
---> 14             process = shell.spawn("sh", "-c", "echo hello")
     15             result = process.wait_for_result()
     16             print result.output

/home/adsl/anaconda2/lib/python2.7/site-packages/spur/ssh.pyc in spawn(self, command, *args, **kwargs)
    169         use_pty = kwargs.pop("use_pty", False)
    170         encoding = kwargs.pop("encoding", None)
--> 171         command_in_cwd = self._shell_type.generate_run_command(command, *args, store_pid=store_pid, **kwargs)
    172         try:
    173             channel = self._get_ssh_transport().open_session()

TypeError: generate_run_command() got multiple values for keyword argument 'store_pid'

In [4]:
import spur
shell = spur.LocalShell()
process = shell.spawn("sh", "-c", "pwd")
result = process.wait_for_result()
print result.output



ValueErrorTraceback (most recent call last)
<ipython-input-4-a165fed1c015> in <module>()
      1 import spur
      2 shell = spur.LocalShell()
----> 3 process = shell.spawn("sh", "-c", "pwd")
      4 result = process.wait_for_result()
      5 print result.output

/home/adsl/anaconda2/lib/python2.7/site-packages/spur/local.pyc in spawn(self, command, *args, **kwargs)
     66                 stderr=stderr_arg,
     67                 bufsize=0,
---> 68                 **self._subprocess_args(command, *args, **kwargs)
     69             )
     70         except OSError as error:

/home/adsl/anaconda2/lib/python2.7/site-packages/spur/local.pyc in _subprocess_args(self, command, cwd, update_env, new_process_group)
    125         if update_env is not None:
    126             new_env = os.environ.copy()
--> 127             new_env.update(update_env)
    128             kwargs["env"] = new_env
    129         if new_process_group:

ValueError: dictionary update sequence element #0 has length 1; 2 is required