import pxssh from pexpect instead

Issue #61 resolved
Zachary Ulissi created an issue

pexpect can provide pxssh and is easy to find/install. pxssh is not available as a standalone package in pip/etc.

changing 'import pxssh' to 'from pexpect import pxssh' in utilities.py solves this problem and makes dependencies easier.

Comments (3)

  1. andrew_peterson repo owner

    Depends on the version, I guess. On our cluster, it looks like pexpect is version 2.4 and it does not have this. On my ubuntu personal machine, pexpect is version 4.0.1 and does. So we would need some sort of version checking or try loop, as in

    try:
        from pexpect import pxssh
    except ImportError:
        import pxssh
    

    which might be hard to remember to type as we import pxssh several places in the code (including within methods so that it isn't a requirement for serial processing). I wonder if there is a way to only have to implement the version checking once somewhere?

  2. Log in to comment