我已经在 Windows 7 上安装了 wexpect。现在,当我尝试运行任何命令时,我收到以下错误。我正在使用 MKS 工具包,所以ls
是一个有效的命令。
>>> import pexpect
>>> pexpect.run('ls ')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Python27\lib\site-packages\winpexpect-1.5-py2.7.egg\pexpect.py", line
219, in run
child = spawn(command, maxread=2000, logfile=logfile, cwd=cwd, env=env)
File "C:\Python27\lib\site-packages\winpexpect-1.5-py2.7.egg\pexpect.py", line
429, in __init__
self._spawn (command, args)
File "C:\Python27\lib\site-packages\winpexpect-1.5-py2.7.egg\pexpect.py", line
516, in _spawn
raise ExceptionPexpect ('The command was not found or was not executable: %s
.' % self.command)
pexpect.ExceptionPexpect: The command was not found or was not executable: ls.
有人可以帮忙吗?