我试图从pexpect导入pxssh。但我得到以下错误,我不知道如何解决这个问题。
>>> from pexpect import pxssh
Traceback (most recent call last):
File "<input>", line 1, in <module>
File "C:\Program Files (x86)\JetBrains\PyCharm 5.0.4\helpers\pydev\pydev_import_hook.py", line 21, in do_import
module = self._system_import(name, *args, **kwargs)
File "C:\Program Files (x86)\JetBrains\PyCharm 5.0.4\helpers\pydev\pydev_import_hook.py", line 21, in do_import
module = self._system_import(name, *args, **kwargs)
File "C:\Python34\lib\site-packages\pexpect\pxssh.py", line 23, in <module>
from pexpect import ExceptionPexpect, TIMEOUT, EOF, spawn
ImportError: cannot import name 'spawn'
有人可以帮忙吗? 提前谢谢!
答案 0 :(得分:0)
请检查您的Pexpect版本是否类似于2.3,如果是这样,您需要将软件包更新到4.2或更高版本。要执行此操作,请执行以下操作:
sudo easy_install --upgrade pexpect