使用cpan安装后仍未找到Perl模块

时间:2017-04-20 15:23:28

标签: perl perl-module cpan

我无法使用名为RepeatMasker的程序来工作。我收到以下错误:

~$ RepeatMasker
Can't locate Text/Soundex.pm in @INC (you may need to
install the Text::Soundex module) (@INC contains: /home/florian/Masterarbeit/RepeatMasker
/etc/perl
/usr/local/lib/x86_64-linux-gnu/perl/5.22.1
/usr/local/share/perl/5.22.1
/usr/lib/x86_64-linux-gnu/perl5/5.22 
/usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl/5.22
/usr/share/perl/5.22 /usr/local/lib/site_perl
/usr/lib/x86_64-linux-gnu/perl-base .) 
at /home/florian/Masterarbeit/RepeatMasker/Taxonomy.pm line 83.

BEGIN failed--compilation aborted at /home/florian/Masterarbeit/RepeatMasker/Taxonomy.pm line 83.
Compilation failed in require at /home/florian/Masterarbeit/RepeatMasker/RepeatMasker line 313.
BEGIN failed--compilation aborted at /home/florian/Masterarbeit/RepeatMasker/RepeatMasker line 313.

现在,我尝试通过cpan / cpanm安装缺少的模块:

~$ cpan install Text::Soundex
Loading internal null logger. Install Log::Log4perl for logging messages
CPAN: Storable loaded ok (v2.53_01)
Reading '/home/florian/.cpan/Metadata'
  Database was generated on Thu, 20 Apr 2017 11:41:02 GMT
Running install for module 'Text::Soundex'
CPAN: Digest::SHA loaded ok (v5.95)
CPAN: Compress::Zlib loaded ok (v2.068)
Checksum for /home/florian/.cpan/sources/authors/id/R/RJ/RJBS/Text-Soundex-3.05.tar.gz ok
CPAN: File::Temp loaded ok (v0.2304)
CPAN: YAML loaded ok (v1.15)
CPAN: CPAN::Meta::Requirements loaded ok (v2.140)
CPAN: Parse::CPAN::Meta loaded ok (v1.4414)
CPAN: CPAN::Meta loaded ok (v2.150005)
CPAN: Module::CoreList loaded ok (v5.20151213)
Configuring R/RJ/RJBS/Text-Soundex-3.05.tar.gz with Makefile.PL
WARNING: Option INSTALLDIRS=site was not recognized. (ignoring)
The XS code will be compiled.
Checking if your kit is complete...
Looks good
Generating a Unix-style Makefile
Writing Makefile for Text::Soundex
Writing MYMETA.yml and MYMETA.json
  RJBS/Text-Soundex-3.05.tar.gz
  /usr/bin/perl Makefile.PL INSTALLDIRS=site -- OK
Running make for R/RJ/RJBS/Text-Soundex-3.05.tar.gz
cp Soundex.pm blib/lib/Text/Soundex.pm
Running Mkbootstrap for Text::Soundex ()
chmod 644 "Soundex.bs"
"/usr/bin/perl" "/usr/share/perl/5.22/ExtUtils/xsubpp"  -typemap "/usr/share/perl/5.22/ExtUtils/typemap"  Soundex.xs > Soundex.xsc && mv Soundex.xsc Soundex.c
x86_64-linux-gnu-gcc -c   -D_REENTRANT -D_GNU_SOURCE -DDEBIAN -fwrapv -fno-strict-aliasing -pipe -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -g   -DVERSION=\"3.05\" -DXS_VERSION=\"3.05\" -fPIC "-I/usr/lib/x86_64-linux-gnu/perl/5.22/CORE"   Soundex.c
rm -f blib/arch/auto/Text/Soundex/Soundex.so
x86_64-linux-gnu-gcc  -shared -L/usr/local/lib -fstack-protector-strong Soundex.o  -o blib/arch/auto/Text/Soundex/Soundex.so    \
        \

chmod 755 blib/arch/auto/Text/Soundex/Soundex.so
"/usr/bin/perl" -MExtUtils::Command::MM -e 'cp_nonempty' -- Soundex.bs blib/arch/auto/Text/Soundex/Soundex.bs 644
Manifying 1 pod document
  RJBS/Text-Soundex-3.05.tar.gz
  /usr/bin/make -- OK
Running make test
Running Mkbootstrap for Text::Soundex ()
chmod 644 "Soundex.bs"
PERL_DL_NONLAZY=1 "/usr/bin/perl" "-MExtUtils::Command::MM" "-MTest::Harness" "-e" "undef *Test::Harness::Switches; test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
t/basic.t .. ok    
All tests successful.
Files=1, Tests=18,  0 wallclock secs ( 0.01 usr +  0.00 sys =  0.01 CPU)
Result: PASS
  RJBS/Text-Soundex-3.05.tar.gz
  /usr/bin/make test -- OK
Running make install
Manifying 1 pod document
Files found in blib/arch: installing files in blib/lib into architecture dependent library tree
Installing /home/florian/perl5/lib/perl5/x86_64-linux-gnu-thread-multi/auto/Text/Soundex/Soundex.so
Appending installation info to /home/florian/perl5/lib/perl5/x86_64-linux-gnu-thread-multi/perllocal.pod
  RJBS/Text-Soundex-3.05.tar.gz
  /usr/bin/make install  -- OK

似乎有效。但我仍然得到同样的错误。我很丢失,是否安装在错误的位置?在哪里?

1 个答案:

答案 0 :(得分:6)

您已配置CPAN正在将模块安装在非标准位置(/home/florian/perl5/lib/perl5),但您没有告诉Perl查找模块。

export PERL5LIB=/home/florian/perl5/lib/perl5

use lib qw( /home/florian/perl5/lib/perl5 );