Sunday, May 12, 2024
 Popular · Latest · Hot · Upcoming
0
rated 0 times [  0] [ 0]  / answers: 1 / hits: 1527  / 2 Years ago, mon, october 17, 2022, 7:02:00

I run:


sudo apt-get install python-pexpect

On my Ubuntu server 12.04 LTS, I have both Python2.7 and Python3.1.3


I run this script using python3.1.3 script.py, then python script.py but I get this error:


ImportError: No module name: pyssh


Why does this happen ?
After running the above command: will I be able to use pexpect both from python3.1.3 and python2.7 ? (i even guessed I have python3.2)


More From » server

 Answers
1

PySSH is a Python module for programmatically controlling ssh and scp.
NOTE: This project is no longer maintained. Please consider using
Paramiko (http://www.lag.net/paramiko/) instead.




Actually paramiko only works for python 2.x



pexpect works with python3 but only with recent releases (14.04).



So to run your code, you have to stay with python2 unless you install the git master branch of paramiko which now supports python 3.2.


[#24982] Tuesday, October 18, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
howesale

Total Points: 224
Total Questions: 117
Total Answers: 116

Location: Nauru
Member since Thu, May 18, 2023
1 Year ago
;