perl 在 @INC 中找不到模块 Math::Pari 的可加载对象

标签 perl ssh cpan pari

我编写了一个 perl 脚本,它在我的环境中运行良好,但在我的客户端环境中它失败了:

Can't locate loadable object for module Math::Pari in @INC (@INC contains: Error-0.17020/lib        JSON-2.57/lib URI-1.60 libwww-perl-5.836/lib Net-Address-IP-Local-0.1.2/lib Math-GMP-2.06/ Net-     SSH-Perl-1.35/lib/ /etc/perl /usr/local/lib/perl/5.14.2 /usr/local/share/perl/5.14.2  /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.14 /usr/share/perl/5.14 /usr/local/lib/site_perl  .) at Net-SSH-Perl-1.35/lib//Net/SSH/Perl/Util/SSH2MP.pm line 6
Compilation failed in require at Net-SSH-Perl-1.35/lib//Net/SSH/Perl/Util/SSH2MP.pm line 6,  <GEN0> line 1.
BEGIN failed--compilation aborted at Net-SSH-Perl-1.35/lib//Net/SSH/Perl/Util/SSH2MP.pm line  6,  <GEN0> line 1.
Compilation failed in require at Net-SSH-Perl-1.35/lib//Net/SSH/Perl/Util.pm line 56, <GEN0>  line 1.
BEGIN failed--compilation aborted at Net-SSH-Perl-1.35/lib//Net/SSH/Perl/Kex/DH1.pm line 10,  <GEN0> line 1.
Compilation failed in require at Net-SSH-Perl-1.35/lib//Net/SSH/Perl/Kex.pm line 6, <GEN0>  line 1.
BEGIN failed--compilation aborted at Net-SSH-Perl-1.35/lib//Net/SSH/Perl/Kex.pm line 6,  <GEN0> line 1.
Compilation failed in require at Net-SSH-Perl-1.35/lib//Net/SSH/Perl/SSH2.pm line 6, <GEN0>  line 1.
BEGIN failed--compilation aborted at Net-SSH-Perl-1.35/lib//Net/SSH/Perl/SSH2.pm line 6,  <GEN0> line 1.
Compilation failed in require at Net-SSH-Perl-1.35/lib//Net/SSH/Perl.pm line 52, <GEN0> line   1.
the user: ll was successfully added to the automation machine.notroot@ubuntu:~/autom    ation$ vim install.pl 

我试图添加
使用库“数学”;
包含 Math-Pari-2.0305_01080605 模块的内容,但没有运气:/

我不希望我的客户自己安装 cpan 软件包 - 它应该是完全独立于环境的产品。

我宁愿避免从“Net-SSH-Perl-1.35”切换,因为我的大部分代码都依赖于它。

提前10倍!

更新 :
我正在重写更新以澄清事情:

我的出发点是以下库:
use lib 'Net-SSH-Perl-1.35/lib/'; 
use lib 'Math-GMP-2.06/'; 
use lib 'Net-Address-IP-Local-0.1.2/lib';
use lib 'libwww-perl-5.836/lib';
use lib 'URI-1.60';
use lib 'JSON-2.57/lib';
use lib 'Error-0.17020/lib';
use Net::SSH::Perl;
use LWP::Simple;
use JSON qw( decode_json );
use POSIX qw/strftime/;
use Net::Address::IP::Local;

输出以下内容:
Can't locate Math/Pari.pm in @INC (@INC contains: Error-0.17020/lib JSON-2.57/lib URI-1.60 libwww-  perl-5.836/lib Net-Address-IP-Local-0.1.2/lib Math-GMP-2.06/ Net-SSH-Perl-1.35/lib/ /etc/perl    /usr/local/lib/perl/5.14.2 /usr/local/share/perl/5.14.2 /usr/lib/perl5 /usr/share/perl5     /usr/lib/perl/5.14 /usr/share/perl/5.14 /usr/local/lib/site_perl .) at Net-SSH-Perl-  1.35/lib//Net/SSH/Perl/Util/SSH2MP.pm line 6, <GEN0> line 1.
BEGIN failed--compilation aborted at Net-SSH-Perl-1.35/lib//Net/SSH/Perl/Util/SSH2MP.pm line 6,  <GEN0> line 1.
Compilation failed in require at Net-SSH-Perl-1.35/lib//Net/SSH/Perl/Util.pm line 56, <GEN0> line   1.
 BEGIN failed--compilation aborted at Net-SSH-Perl-1.35/lib//Net/SSH/Perl/Kex/DH1.pm line 10  ,  <GEN0> line 1.
Compilation failed in require at Net-SSH-Perl-1.35/lib//Net/SSH/Perl/Kex.pm line 6, <GEN0> line 1.
BEGIN failed--compilation aborted at Net-SSH-Perl-1.35/lib//Net/SSH/Perl/Kex.pm line 6, <GEN0> line 1.
Compilation failed in require at Net-SSH-Perl-1.35/lib//Net/SSH/Perl/SSH2.pm line 6, <GEN0> line 1  .

BEGIN 失败--编译中止...

为了解决这个问题,我添加了下一条语句:

使用库'Math-Pari-2.010709';

并且错误更改为:
Can't locate loadable object for module Math::Pari in @INC (@INC contains: Math-Pari-2.010709 Error- 0.17020/lib JSON-2.57/lib URI-1.60 libwww-perl-5.836/lib Net-Address-IP-Local-0.1.2/lib Math-GMP-2.06/  Net-SSH-Perl-1.35/lib/ /etc/perl /usr/local/lib/perl/5.14.2 /usr/local/share/perl/5.14.2 /usr/lib/perl5  /usr/share/perl5 /usr/lib/perl/5.14 /usr/share/perl/5.14 /usr/local/lib/site_perl .) at Net-SSH-Perl- 1.35/lib//Net/SSH/Perl/Util/SSH2MP.pm line 6
Compilation failed in require at Net-SSH-Perl-1.35/lib//Net/SSH/Perl/Util/SSH2MP.pm line 6, <GEN0> line   1.
BEGIN failed--compilation aborted at Net-SSH-Perl-1.35/lib//Net/SSH/Perl/Util/SSH2MP.pm line 6, <GEN0>  line 1.
Compilation failed in require at Net-SSH-Perl-1.35/lib//Net/SSH/Perl/Util.pm line 56, <GEN0> line 1.
BEGIN failed--compilation aborted at Net-SSH-Perl-1.35/lib//Net/SSH/Perl/Kex/DH1.pm line 10, <GEN0>  line 1.
Compilation failed in require at Net-SSH-Perl-1.35/lib//Net/SSH/Perl/Kex.pm line 6, <GEN0> line 1.
BEGIN failed--compilation aborted at Net-SSH-Perl-1.35/lib//Net/SSH/Perl/Kex.pm line 6, <GEN0> line 1.
Compilation failed in require at Net-SSH-Perl-1....

这是 Math-Pari-2.010709 的内容:
drwxr-xr-x  3 notroot notroot 4096 May  7 14:38 ./
drwxr-xr-x 11 notroot notroot 4096 May  7 21:30 ../
drwxr-xr-x  7 notroot notroot 4096 May  7 14:38 Math/

数学-Pari-2.010709/数学:
total 240
drwxr-xr-x 7 notroot notroot  4096 May  7 14:38 ./
drwxr-xr-x 3 notroot notroot  4096 May  7 14:38 ../ 
-r--r--r-- 1 notroot notroot 27440 Oct 25  2006 Changes
-r--r--r-- 1 notroot notroot 17793 Feb  1  2004 func_codes.h
-r--r--r-- 1 notroot notroot  8676 Aug  9  2006 INSTALL 
drwxr-xr-x 2 notroot notroot  4096 Oct 25  2006 libPARI/
-r--r--r-- 1 notroot notroot  7573 Oct 25  2006 Makefile.PL
-r--r--r-- 1 notroot notroot   780 Nov 11  2005 MANIFEST
-r--r--r-- 1 notroot notroot   297 Oct 25  2006 META.yml
-r--r--r-- 1 notroot notroot  1322 Aug 23  2006 PariInit.pm
-r--r--r-- 1 notroot notroot 35680 Oct 25  2006 Pari.pm
-r--r--r-- 1 notroot notroot 79499 Oct 18  2006 Pari.xs
drwxr-xr-x 2 notroot notroot  4096 Oct 25  2006 patches/
-r--r--r-- 1 notroot notroot  4286 Jan 30  2004 README
drwxr-xr-x 2 notroot notroot  4096 Oct 25  2006 t/
drwxr-xr-x 2 notroot notroot  4096 Oct 25  2006 test_eng/
-r--r--r-- 1 notroot notroot  1142 Jan 20  2005 TODO
-r--r--r-- 1 notroot notroot  1361 Jul  8  2001 typemap
drwxr-xr-x 3 notroot notroot  4096 Oct 25  2006 utils/

我需要说的是 Math-Pari-2.010709 中最初不存在 Math 文件夹,所以我创建了它并将 Math-Pari-2.010709 的内容移到其中,以便 perl 正在寻找位置。

在这个阶段,我添加了:
使用数学::Pari

但似乎没有什么区别:
Can't locate loadable object for module Math::Pari in @INC (@INC contains: Math-Pari-2.010709 Error- 0.17020/lib JSON-2.57/lib URI-1.60 libwww-perl-5.836/lib Net-Address-IP-Local-0.1.2/lib Math-GMP-2.06/    Net-SSH-Perl-1.35/lib/ /etc/perl /usr/local/lib/perl/5.14.2 /usr/local/share/perl/5.14.2 /usr/lib/perl5  /usr/share/perl5 /usr/lib/perl/5.14 /usr/share/perl/5.14 /usr/local/lib/site_perl .) at ./install.pl  line 24
Compilation failed in require at ./install.pl line 24.
BEGIN failed--compilation aborted at ./install.pl line 24.

我总结了我迄今为止的所有尝试。

我将不胜感激任何帮助!

最佳答案

有许多 CPAN 发行版必须经过构建和安装过程;您不能只是从 CPAN 解压文件并将 perl 指向它们。

Math::Pari 是一;它必须编译绑定(bind)到外部库(也必须存在)。

你对这种方法不走运。

关于perl 在 @INC 中找不到模块 Math::Pari 的可加载对象,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16423392/

相关文章:

perl - 在一台机器上安装多个 Perl 共享一个 cpan_home 是否安全?

perl - 如何将 CPAN 的配置从 local::lib 更改为 sudo 首选项

Perl Mechanize 遇到错误 : failed connecting to "localhost", 端口 4242 : so what?

perl - 让Perl返回正确的退出代码

Java 程序在 Eclipse 中运行良好,但不能作为 .jar 文件运行(配置路径是否错误?)

Ruby Net::SSH 未定义方法 'shell'

xml - 在 Perl 中从 XML 文件中提取一些元素值的最快方法是什么?

perl - 在 perl 项目中使用 maven

linux - 无密码 SSH 最佳实践

perl - 当安装了两个版本的模块时 Perl 会做什么?