ImportError: no module named pxssh

I try to use the pxssh module to connect SSH to the client - however, I get

 ImportError: No module named pxssh 

I found this file in a Python installation, so I would suggest that the correct one

 /usr/lib/python2.7/site-packages/pexpect/pxssh.py 

Of course, I run my application with Python 2.7, and even tried to import pexpect , but that did not help.

So, any clues? thanks

+6
source share
3 answers

Well, try from pexpect import pxssh .

update:


The solution works only for Linux, since pxssh not supported on Windows

+13
source

If the problem is not fixed by the previous sentence:

 from pexpect import pxssh 

The pexpect library may be deprecated, so do:

  sudo pip install pexpect --upgrade 
+4
source

If / usr / lib / python 2.7 / site-packages / pexpect / pxssh.py exists, use the following command

python2.7 'yourprogram.py'

since the python command is not related to version 2.7. Please check python -V to get the version.

0
source

All Articles