perl在@INC中找不到模块Math :: Pari的可加载对象 [英] perl Can't locate loadable object for module Math::Pari in @INC
问题描述
我编写了一个perl脚本,该脚本可以在我的环境中正常运行,但是在我的客户端环境中,它会在以下情况下失败:
I've written a perl script which run's fine on my environment, but on my client environment it fails on:
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
我尝试使用lib'Math'添加
;
包含Math-Pari-2.0305_01080605模块的内容,但是没有运气:/
I've tried to add use lib 'Math'; with the contains the content of Math-Pari-2.0305_01080605 module, but no luck :/
我不希望我的客户端从以下位置安装cpan软件包
I don't want my client to install cpan packages from by him self - it should be fully environment independent product.
我宁愿避免从 Net-SSH-Perl-1.35切换,因为我的大部分代码取决于
I prefer to avoid switching from "Net-SSH-Perl-1.35" since large parts of my code depends on it.
提前10倍!
更新:
我我正在重写更新以澄清问题:
UPDATE: I'm rewriting the update to clarify things up:
我的起点是使用以下库:
my starting point was with the following libraries:
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失败-编译中止...
BEGIN failed--compilation aborted ...
为了解决这个问题,我添加了下一条语句:
In order to fix that I've added the next statement:
使用lib'Math-Pari-2.010709';
use lib '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的内容:
this is the content of 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/
Math-Pari-2.010709 / Math:
Math-Pari-2.010709/Math:
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文件夹最初在Math-Pari-2.010709中不存在,所以我ve创建了它,并将Math-Pari-2.010709内容移到了其中,以使perl能够找到位置。
I need to say that the folder Math didn't originally exist at Math-Pari-2.010709, so I've created it and moved Math-Pari-2.010709 content into it in order location perl was looking for.
在此阶段,我添加了:
使用Math :: Pari
In this stage I've added: use Math::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.
我将总结到目前为止的所有尝试。
I thing that summarize all my attempts so far.
我将不胜感激!
推荐答案
有许多CPAN发行版都必须经过构建和安装过程。
There are many many CPAN distributions that must go through a build and install process; you cannot just unpack the files from CPAN and point perl at them.
Math :: Pari是其中之一;您不能仅仅从CPAN中解压缩文件并将perl指向它们。它必须编译到外部库的绑定(也必须存在)。
Math::Pari is one; it has to compile bindings to an external library (which also must be present).
这种方法使您很不走运。
You are out of luck with this approach.
这篇关于perl在@INC中找不到模块Math :: Pari的可加载对象的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!