2017-04-20 199 views
0

我無法使一個名爲RepeatMasker的程序正常工作。我收到以下錯誤:使用cpan安裝後仍未找到Perl模塊

~$ 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 

似乎它的工作。但我仍然得到上面的同樣的錯誤。我很迷茫,它是否安裝在錯誤的位置?哪裏?

+2

確保'cpan'和'perl'是同一Perl安裝。調用'哪個perl'和'哪個cpan'開始。也可以用@ perl -E'@ INC''來看'@ INC'。 'cpan'安裝你的模塊的路徑在那裏? – simbabque

+0

如何查看cpan安裝模塊的位置? cpan/perl指向'/ usr/bin/perl','/ usr/bin/cpan' – voiDnyx

回答

6

您已配置CPAN正在將模塊安裝在非標準位置(/home/florian/perl5/lib/perl5),但您沒有告訴Perl在那裏尋找模塊。

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

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

我試過了,但仍然得到相同的錯誤。 '〜$ echo $ PERL5LIB /home/florian/perl5/lib'(也是@INC包含'/ home/florian/perl5/lib',所以它應該找到它嗎?) – voiDnyx

+2

包含路徑是正確的一個目錄更深一層:'/ home/florian/perl5/lib/perl5' – daxim

+0

謝謝,這個修好了:)。在旁註中,我如何重置cpan以安裝到默認位置? – voiDnyx