perl Can't locate loadable object for module Math::Pari in @INC

非 Y 不嫁゛ 提交于 2019-12-23 03:12:11

问题


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 

I've tried to add use lib 'Math'; with the contains the content of Math-Pari-2.0305_01080605 module, but no luck :/

I don't want my client to install cpan packages from by him self - it should be fully environment independent product.

I prefer to avoid switching from "Net-SSH-Perl-1.35" since large parts of my code depends on it.

10x in advance!

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;

which output the following:

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 failed--compilation aborted ...

In order to fix that I've added the next statement:

use lib 'Math-Pari-2.010709';

and the error changed to:

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....

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:

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/

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.

In this stage I've added: use Math::Pari

but it seems that doesn't make a diference:

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.

I would appreciate any help!


回答1:


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 is one; it has to compile bindings to an external library (which also must be present).

You are out of luck with this approach.




回答2:


You may be able to switch to Net::OpenSSH::Compat::Perl that is compatible at the API level with most of Net::SSH::Perl and has less and easier to install dependencies.

Its only non-pure Perl dependencies are IO::Pty required in order to support password authentication and the OpenSSH ssh binary that will be already installed on the machine for Linux and BSD systems or available as a package for Solaris and probably several other unixen.



来源:https://stackoverflow.com/questions/16423392/perl-cant-locate-loadable-object-for-module-mathpari-in-inc

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!