pexpect AttributeError:“module”对象没有属性“spawn”

2024-06-16 09:28:13 发布

您现在位置:Python中文网/ 问答频道 /正文

这里怎么了?你知道吗

$ python -V
Python 2.7.5

我已经安装了pip install pexcept

现在当我加载它时

$ python
Python 2.7.5 (default, Jul 13 2018, 13:06:57)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-28)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import pexpect
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "pexpect.py", line 10, in <module>
    child = pexpect.spawn('ssh %s@%s' % (switch_un, switch_ip))
AttributeError: 'module' object has no attribute 'spawn'
>>> 

编辑

运行Linux CentOS 7.x版本(64位)


Tags: installpipindefaulthatlineredjul