Can't import pxssh from pexpect

断了今生、忘了曾经 提交于 2019-12-24 12:12:45

问题


i'm trying to import pxssh from pexpect. But i get the following error, and i dont know how to solve this.

>>> 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'

Can anyone help? Thanks in advance!


回答1:


Please check if your Pexpect version is something like 2.3, if so, you need to update the package to 4.2 or greater. To do it run the following:

sudo easy_install --upgrade pexpect


来源:https://stackoverflow.com/questions/36087711/cant-import-pxssh-from-pexpect

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!