NET::SSH::Expect 个配置可以解决 windows
NET::SSH::Expect configurations to work over windows
机器详细信息:Windows7,64 位。
我在 eclipse 中集成了 perl 并使用了 Net::SSH::Except 模块来编写脚本,但是我得到了一个错误 Can't locate Net/SSH/Expect.pm in @INC (you may need to install the Net::SSH::Expect
module) (@INC contains: C:/Perl64/site/lib/MSWin32-x64-multi-thread C:/Perl64/site/lib
C:/Perl64/lib .)
因此,我正在尝试使用命令 cpan>notest install IO::Tty
为 Expect 依赖项安装 IO::Tty。
我收到以下错误消息:
并且模块没有安装,甚至 NET::SSH::Expect
也没有安装。
cpan> notest install IO::Tty
Reading 'C:\Perl64\cpan\Metadata'
Database was generated on Mon, 11 Dec 2017 04:41:02 GMT
Fetching with LWP:
http://ppm.activestate.com/CPAN/authors/01mailrc.txt.gz
Reading 'C:\Perl64\cpan\sources\authorsmailrc.txt.gz'
.............................................................DONE
Fetching with LWP:
http://ppm.activestate.com/CPAN/modules/02packages.details.txt.gz
Reading 'C:\Perl64\cpan\sources\modulespackages.details.txt.gz'
Database was generated on Tue, 12 Dec 2017 04:29:02 GMT
.............
**New CPAN.pm version (v2.16) available.
[Currently running version is v2.1101]
You might want to try
install CPAN
reload cpan
to both upgrade CPAN.pm and run the new version without leaving
the current session.**
..............................................................DONE
Fetching with LWP:
http://ppm.activestate.com/CPAN/modules/03modlist.data.gz
Reading 'C:\Perl64\cpan\sources\modulesmodlist.data.gz'
DONE
Writing C:\Perl64\cpan\Metadata
Running install for module 'IO::Tty'
Checksum for C:\Perl64\cpan\sources\authors\id\T\TO\TODDR\IO-Tty-1.12.tar.gz
ok
Scanning cache C:\Perl64/cpan/build for sizes
...............................................................DONE
IO-Tty-1.12/
IO-Tty-1.12/ChangeLog
IO-Tty-1.12/Makefile.PL
IO-Tty-1.12/MANIFEST
IO-Tty-1.12/META.json
IO-Tty-1.12/META.yml
IO-Tty-1.12/Pty.pm
IO-Tty-1.12/README
IO-Tty-1.12/t/
IO-Tty-1.12/try
IO-Tty-1.12/Tty.pm
IO-Tty-1.12/Tty.xs
IO-Tty-1.12/t/test.t
Configuring T/TO/TODDR/IO-Tty-1.12.tar.gz with Makefile.PL
This module requires a POSIX compliant system to work. Try cygwin if you
need this module on windows OS unsupported at Makefile.PL line 6.
Warning: No success on command[C:\Perl64\bin\perl.exe Makefile.PL
INSTALLDIRS=site]
TODDR/IO-Tty-1.12.tar.gz
C:\Perl64\bin\perl.exe Makefile.PL INSTALLDIRS=site -- NOT OK
Failed during this command:
TODDR/IO-Tty-1.12.tar.gz : writemakefile NO
'C:\Perl64\bin\
perl.exe Makefile.PL INSTALLDIRS=site' returned status 65280
我已经尝试使用以下命令安装 IO::Tty
cpanm --install IO::Tty
cpanm --verbose IO::Tty
cpanm --force IO::Tty
全部失败,这可能是由于 perl 版本较低。
从 cmd 升级 cpan 以及通过 cmd 升级 perl 的命令是什么?
遗憾的是,Perl Expect 模块需要基于 UNIX 的 OS 才能运行。我已经在 windows 平台上实现了几次,基本上你需要安装一个较旧的 TCL ActiveState 发行版,然后你可以让 Perl 脚本调用外部 EXPECT 脚本,如下所示:
$expectOutput = `[path_to_expect_script.expect]`;
您的变量将包含 Expect 脚本的输出。
希望对您有所帮助!
编辑:您可能想改写您的标题,以吸引更多与在 windows 上使用 expect 相关的答案。
已解决!
新版Expect兼容windows,但需要安装cygwin..
在 eclipse 中,将解释器设为 cygwin(windows -> 首选项 -> EPIC Perl -> 解释器)。
并执行脚本:)
机器详细信息:Windows7,64 位。
我在 eclipse 中集成了 perl 并使用了 Net::SSH::Except 模块来编写脚本,但是我得到了一个错误 Can't locate Net/SSH/Expect.pm in @INC (you may need to install the Net::SSH::Expect
module) (@INC contains: C:/Perl64/site/lib/MSWin32-x64-multi-thread C:/Perl64/site/lib
C:/Perl64/lib .)
因此,我正在尝试使用命令 cpan>notest install IO::Tty
为 Expect 依赖项安装 IO::Tty。
我收到以下错误消息:
并且模块没有安装,甚至 NET::SSH::Expect
也没有安装。
cpan> notest install IO::Tty
Reading 'C:\Perl64\cpan\Metadata'
Database was generated on Mon, 11 Dec 2017 04:41:02 GMT
Fetching with LWP:
http://ppm.activestate.com/CPAN/authors/01mailrc.txt.gz
Reading 'C:\Perl64\cpan\sources\authorsmailrc.txt.gz'
.............................................................DONE
Fetching with LWP:
http://ppm.activestate.com/CPAN/modules/02packages.details.txt.gz
Reading 'C:\Perl64\cpan\sources\modulespackages.details.txt.gz'
Database was generated on Tue, 12 Dec 2017 04:29:02 GMT
.............
**New CPAN.pm version (v2.16) available.
[Currently running version is v2.1101]
You might want to try
install CPAN
reload cpan
to both upgrade CPAN.pm and run the new version without leaving
the current session.**
..............................................................DONE
Fetching with LWP:
http://ppm.activestate.com/CPAN/modules/03modlist.data.gz
Reading 'C:\Perl64\cpan\sources\modulesmodlist.data.gz'
DONE
Writing C:\Perl64\cpan\Metadata
Running install for module 'IO::Tty'
Checksum for C:\Perl64\cpan\sources\authors\id\T\TO\TODDR\IO-Tty-1.12.tar.gz
ok
Scanning cache C:\Perl64/cpan/build for sizes
...............................................................DONE
IO-Tty-1.12/
IO-Tty-1.12/ChangeLog
IO-Tty-1.12/Makefile.PL
IO-Tty-1.12/MANIFEST
IO-Tty-1.12/META.json
IO-Tty-1.12/META.yml
IO-Tty-1.12/Pty.pm
IO-Tty-1.12/README
IO-Tty-1.12/t/
IO-Tty-1.12/try
IO-Tty-1.12/Tty.pm
IO-Tty-1.12/Tty.xs
IO-Tty-1.12/t/test.t
Configuring T/TO/TODDR/IO-Tty-1.12.tar.gz with Makefile.PL
This module requires a POSIX compliant system to work. Try cygwin if you
need this module on windows OS unsupported at Makefile.PL line 6.
Warning: No success on command[C:\Perl64\bin\perl.exe Makefile.PL
INSTALLDIRS=site]
TODDR/IO-Tty-1.12.tar.gz
C:\Perl64\bin\perl.exe Makefile.PL INSTALLDIRS=site -- NOT OK
Failed during this command:
TODDR/IO-Tty-1.12.tar.gz : writemakefile NO
'C:\Perl64\bin\
perl.exe Makefile.PL INSTALLDIRS=site' returned status 65280
我已经尝试使用以下命令安装 IO::Tty
cpanm --install IO::Tty
cpanm --verbose IO::Tty
cpanm --force IO::Tty
全部失败,这可能是由于 perl 版本较低。
从 cmd 升级 cpan 以及通过 cmd 升级 perl 的命令是什么?
遗憾的是,Perl Expect 模块需要基于 UNIX 的 OS 才能运行。我已经在 windows 平台上实现了几次,基本上你需要安装一个较旧的 TCL ActiveState 发行版,然后你可以让 Perl 脚本调用外部 EXPECT 脚本,如下所示:
$expectOutput = `[path_to_expect_script.expect]`;
您的变量将包含 Expect 脚本的输出。
希望对您有所帮助!
编辑:您可能想改写您的标题,以吸引更多与在 windows 上使用 expect 相关的答案。
已解决!
新版Expect兼容windows,但需要安装cygwin..
在 eclipse 中,将解释器设为 cygwin(windows -> 首选项 -> EPIC Perl -> 解释器)。
并执行脚本:)