无法在Cygwin中运行pexpect

1 投票
1 回答
1085 浏览
提问于 2025-04-15 22:09

在Cygwin的命令行中执行pexpect示例文件时出现了以下错误。有没有人能帮忙解决一下?

Administrator@INDSQA2253 /cygdrive/c/Python26/Tools/pexpect-2.1/examples
$ python ssh_session.py
Traceback (most recent call last):
  File "ssh_session.py", line 7, in <module>
    from pexpect import *
  File "c:\Python26\lib\site-packages\pexpect.py", line 83, in <module>
    Pexpect is intended for UNIX-like operating systems.""")
ImportError: No module named resource
A critical module was not found. Probably this operating system does not support
 it.
Pexpect is intended for UNIX-like operating systems.

请问Pexpect能在Cygwin中运行Windows版的Python吗?

1 个回答

1

试着从Cygwin安装Python。我说的是Cygwin里的Python,可以直接安装的那种。

撰写回答