【问题标题】:How to automatically install all dependendicies in cpan Bio如何在 cpan Bio 中自动安装所有依赖项
【发布时间】:2020-05-30 03:47:34
【问题描述】:

你好,我实际上是在尝试安装一个名为 HMMCleaner 的 perl 包

我为此运行了命令:

cpan Bio::MUST::Apps::HmmCleaner

但在此过程中,我收到了几条消息:Warning: prerequisite something 0 not found.

这是输出的头:

(/beegfs/data/me/myconda) me@pbil-deb:/beegfs/data/me/TOOLS/Bio-MUST-Apps-HmmCleaner-0.180750/bin$ cpan Test::Harness::Straps
Loading internal null logger. Install Log::Log4perl for logging messages
Reading '/beegfs/home/me/.cpan/Metadata'
  Database was generated on Fri, 14 Feb 2020 09:41:03 GMT
Running install for module 'Test::Harness::Straps'
Fetching with LWP:
http://www.cpan.org/authors/id/M/MS/MSCHWERN/Test-Harness-Straps-0.30.tar.gz
Fetching with LWP:
http://www.cpan.org/authors/id/M/MS/MSCHWERN/CHECKSUMS
Checksum for /beegfs/home/me/.cpan/sources/authors/id/M/MS/MSCHWERN/Test-Harness-Straps-0.30.tar.gz ok
Configuring M/MS/MSCHWERN/Test-Harness-Straps-0.30.tar.gz with Build.PL
Test::Harness::Straps is provided for backwards compatibility only.
No further development is planned.  No bugs will be fixed.

For customizable TAP parsing please use L<TAP::Parser> instead.

Created MYMETA.yml and MYMETA.json
Creating new 'Build' script for 'Test-Harness-Straps' version '0.30'
  MSCHWERN/Test-Harness-Straps-0.30.tar.gz
  /beegfs/data/me/myconda/bin/perl Build.PL --installdirs site -- OK
Running Build for M/MS/MSCHWERN/Test-Harness-Straps-0.30.tar.gz
Building Test-Harness-Straps
  MSCHWERN/Test-Harness-Straps-0.30.tar.gz
  ./Build -- OK
Running Build test
t/00compile.t ...... 1/5 # Testing Test::Harness::Straps 0.30 under Perl 5.026002 and Test::More 1.302073
t/00compile.t ...... ok   
t/callback.t ....... ok     
t/point-parse.t .... ok     
t/point.t .......... ok     
t/strap-analyze.t .. ok       
t/strap.t .......... ok     
All tests successful.
Files=6, Tests=425,  9 wallclock secs ( 0.12 usr  0.04 sys +  0.98 cusr  0.67 csys =  1.81 CPU)
Result: PASS
  MSCHWERN/Test-Harness-Straps-0.30.tar.gz
  ./Build test -- OK
Running Build install
Building Test-Harness-Straps
Installing /beegfs/home/me/perl5/lib/perl5/Test/Harness/Assert.pm
Installing /beegfs/home/me/perl5/lib/perl5/Test/Harness/Straps.pm
Installing /beegfs/home/me/perl5/lib/perl5/Test/Harness/Results.pm
Installing /beegfs/home/me/perl5/lib/perl5/Test/Harness/Point.pm
Installing /beegfs/home/me/perl5/lib/perl5/Test/Harness/Iterator.pm
Installing /beegfs/home/me/perl5/man/man3/Test::Harness::Point.3
Installing /beegfs/home/me/perl5/man/man3/Test::Harness::Assert.3
Installing /beegfs/home/me/perl5/man/man3/Test::Harness::Results.3
Installing /beegfs/home/me/perl5/man/man3/Test::Harness::Iterator.3
Installing /beegfs/home/me/perl5/man/man3/Test::Harness::Straps.3
  MSCHWERN/Test-Harness-Straps-0.30.tar.gz
  ./Build install  -- OK
(/beegfs/data/me/myconda) me@pbil-deb:/beegfs/data/me/TOOLS/Bio-MUST-Apps-HmmCleaner-0.180750/bin$ cpan Bio::MUST::Apps::HmmCleaner
Loading internal null logger. Install Log::Log4perl for logging messages
Reading '/beegfs/home/me/.cpan/Metadata'
  Database was generated on Fri, 14 Feb 2020 09:41:03 GMT
Running install for module 'Bio::MUST::Apps::HmmCleaner'
Checksum for /beegfs/home/me/.cpan/sources/authors/id/A/AR/ARNODF/Bio-MUST-Apps-HmmCleaner-0.180750.tar.gz ok
Configuring A/AR/ARNODF/Bio-MUST-Apps-HmmCleaner-0.180750.tar.gz with Makefile.PL
Checking if your kit is complete...
Looks good
Warning: prerequisite Bio::FastParsers::Hmmer 0 not found.
Warning: prerequisite Bio::MUST::Core 0.180230 not found.
Warning: prerequisite Bio::MUST::Core::Ali 0 not found.
Warning: prerequisite Bio::MUST::Core::Constants 0 not found.
Warning: prerequisite Bio::MUST::Core::GeneticCode::Factory 0 not found.
Warning: prerequisite Bio::MUST::Core::IdList 0 not found.
Warning: prerequisite Bio::MUST::Core::Seq 0 not found.
Warning: prerequisite Bio::MUST::Core::SeqMask 0 not found.
Warning: prerequisite Bio::MUST::Core::Utils 0 not found.
Warning: prerequisite Bio::MUST::Drivers 0.180270 not found.
Warning: prerequisite Bio::MUST::Drivers::Hmmer::Model::Temporary 0 not found.
Warning: prerequisite IPC::System::Simple 0 not found.
Warning: prerequisite Smart::Comments 0 not found.
Warning: prerequisite aliased 0 not found.
Generating a Unix-style Makefile
Writing Makefile for Bio::MUST::Apps::HmmCleaner
Writing MYMETA.yml and MYMETA.json
  ARNODF/Bio-MUST-Apps-HmmCleaner-0.180750.tar.gz
  /beegfs/data/me/myconda/bin/perl Makefile.PL INSTALLDIRS=site -- OK
Running make for A/AR/ARNODF/Bio-MUST-Apps-HmmCleaner-0.180750.tar.gz
----     Unsatisfied dependencies detected during    ----
---- ARNODF/Bio-MUST-Apps-HmmCleaner-0.180750.tar.gz ----
    Bio::FastParsers::Hmmer [requires]
    Bio::MUST::Core [requires]
    Bio::MUST::Core::Ali [requires]
    Bio::MUST::Core::Constants [requires]
    Bio::MUST::Core::GeneticCode::Factory [requires]
    Bio::MUST::Core::IdList [requires]
    Bio::MUST::Core::Seq [requires]
    Bio::MUST::Core::SeqMask [requires]
    Bio::MUST::Core::Utils [requires]
    Bio::MUST::Drivers [requires]
    Bio::MUST::Drivers::Hmmer::Model::Temporary [requires]
    IPC::System::Simple [requires]
    Smart::Comments [requires]
    aliased [requires]
Running install for module 'Bio::FastParsers::Hmmer'
Checksum for /beegfs/home/me/.cpan/sources/authors/id/D/DB/DBAURAIN/Bio-FastParsers-0.180470.tar.gz ok
Configuring D/DB/DBAURAIN/Bio-FastParsers-0.180470.tar.gz with Makefile.PL
Checking if your kit is complete...
Looks good
Warning: prerequisite Const::Fast 0 not found.
Warning: prerequisite Exporter::Easy 0 not found.
Warning: prerequisite Smart::Comments 0 not found.
Warning: prerequisite XML::Bare 0.53 not found.
Warning: prerequisite aliased 0 not found.
Generating a Unix-style Makefile
Writing Makefile for Bio::FastParsers
Writing MYMETA.yml and MYMETA.json
  DBAURAIN/Bio-FastParsers-0.180470.tar.gz
  /beegfs/data/me/myconda/bin/perl Makefile.PL INSTALLDIRS=site -- OK
Running make for D/DB/DBAURAIN/Bio-FastParsers-0.180470.tar.gz
---- Unsatisfied dependencies detected during ----
---- DBAURAIN/Bio-FastParsers-0.180470.tar.gz ----
    Const::Fast [requires]
    Exporter::Easy [requires]
    Smart::Comments [requires]
    XML::Bare [requires]
    aliased [requires]
Running install for module 'Const::Fast'

所以我想知道是否有可能直接允许 cpan 安装所需的所有依赖项?

我之所以问,是因为我在尝试使用 Bio::MUST::Apps::HMMCleaner 执行脚本时收到以下错误消息。

Can't locate Smart/Comments.pm in @INC (you may need to install the Smart::Comments module) (@INC contains:
    /beegfs/home/me/perl5/lib/perl5/x86_64-linux-thread-multi
    /beegfs/home/me/perl5/lib/perl5
    /beegfs/data/me/myconda/lib/site_perl/5.26.2/x86_64-linux-thread-multi
    /beegfs/data/me/myconda/lib/site_perl/5.26.2
    /beegfs/data/me/myconda/lib/5.26.2/x86_64-linux-thread-multi
    /beegfs/data/me/myconda/lib/5.26.2
    .
) at HmmCleaner.pl line 16. BEGIN failed--compilation aborted at HmmCleaner.pl line 16.

(为便于阅读添加了换行符。)

一些调试信息:

$ set | grep ^PERL
PERL5LIB=/beegfs/home/me/perl5/lib/perl5
PERL_LOCAL_LIB_ROOT=/beegfs/home/me/perl5
PERL_MB_OPT='--install_base "/beegfs/home/me/perl5"'
PERL_MM_OPT=INSTALL_BASE=/beegfs/home/me/perl5

$ echo 'o conf' | cpan | grep -P '^\s*(make|mbuild)'
Loading internal null logger. Install Log::Log4perl for logging messages
    make               [/usr/bin/X11/make]
    make_arg           []
    make_install_arg   []
    make_install_make_command [/usr/bin/X11/make]
    makepl_arg         [INSTALLDIRS=site]
    mbuild_arg         []
    mbuild_install_arg []
    mbuild_install_build_command [./Build]
    mbuildpl_arg       [--installdirs site]

$ which cpan
/beegfs/data/me/myconda/bin/cpan

$ head -n 1 "$( which cpan )"
#!/beegfs/data/me/myconda/bin/perl

$ which perl
/beegfs/data/me/myconda/bin/perl

$ cpan Smart::Comments
Loading internal null logger. Install Log::Log4perl for logging messages
Reading '/beegfs/home/me/.cpan/Metadata'
  Database was generated on Fri, 14 Feb 2020 09:41:03 GMT
Running install for module 'Smart::Comments'
Checksum for /beegfs/home/me/.cpan/sources/authors/id/N/NE/NEILB/Smart-Comments-1.06.tar.gz ok
Configuring N/NE/NEILB/Smart-Comments-1.06.tar.gz with Makefile.PL
Checking if your kit is complete...
Looks good
Generating a Unix-style Makefile
Writing Makefile for Smart::Comments
Writing MYMETA.yml and MYMETA.json
  NEILB/Smart-Comments-1.06.tar.gz
  /beegfs/data/me/myconda/bin/perl Makefile.PL INSTALLDIRS=site -- OK
Running make for N/NE/NEILB/Smart-Comments-1.06.tar.gz
cp lib/Smart/Comments.pm blib/lib/Smart/Comments.pm
Manifying 1 pod document
  NEILB/Smart-Comments-1.06.tar.gz
  /usr/bin/X11/make -- OK
Running make test
PERL_DL_NONLAZY=1 "/beegfs/data/me/myconda/bin/perl" "-MExtUtils::Command::MM" "-MTest::Harness" "-e" "undef *Test::Harness::Switches; test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
t/00.load.t ................. 1/1 # Testing Smart::Comments 1.06
t/00.load.t ................. ok   
t/assert.t .................. ok   
t/brackets.t ................ ok    
t/c_like_for_loop.t ......... ok   
t/check.t ................... ok   
t/confirm.t ................. ok   
t/ensure.t .................. ok   
t/ENV_0.t ................... ok   
t/ENV_1.t ................... ok   
t/ENV_str.t ................. ok   
t/insist.t .................. ok   
t/labelled_perlish_loop.t ... ok   
t/message.t ................. ok   
t/perlish_for.t ............. ok   
t/perlish_for_percentage.t .. ok   
t/pod-coverage.t ............ skipped: Test::Pod::Coverage 1.04 required for testing POD coverage
t/pod.t ..................... skipped: Test::Pod 1.14 required for testing POD
t/require.t ................. ok   
t/selective.t ............... ok   
t/simple_perlish_for.t ...... ok   
t/var.t ..................... ok   
t/verify.t .................. ok   
t/while.t ................... ok   
t/while_num.t ............... ok   
All tests successful.
Files=24, Tests=119, 19 wallclock secs ( 0.13 usr  0.08 sys +  2.93 cusr  1.45 csys =  4.59 CPU)
Result: PASS
  NEILB/Smart-Comments-1.06.tar.gz
  /usr/bin/X11/make test -- OK
Running make install
Manifying 1 pod document
Installing /beegfs/home/me/perl5/lib/perl5/Smart/Comments.pm
Installing /beegfs/home/me/perl5/man/man3/Smart::Comments.3
Appending installation info to /beegfs/home/me/perl5/lib/perl5/x86_64-linux-thread-multi/perllocal.pod
  NEILB/Smart-Comments-1.06.tar.gz
  /usr/bin/X11/make install  -- OK

$ perl -e'use Smart::Comments; print "ok\n"'
ok

感谢您的帮助。

【问题讨论】:

    标签: perl cpan


    【解决方案1】:

    这正是它的作用。

    例如,Warning: prerequisite Bio::FastParsers::Hmmer 0 not found. 表示遇到了 Bio::FastParsers::Hmmer 模块版本 0 或更高版本的不满足依赖项。 Bio::MUST::Apps::HmmCleaner 模块由Bio-FastParsers 发行版提供,您可以清楚地看到Bio-FastParsers 正在安装。

    从技术上讲,这是可配置的。

    $ echo 'o conf init prerequisites_policy' | cpan
    ...
    The CPAN module can detect when a module which you are trying to build
    depends on prerequisites. If this happens, it can build the
    prerequisites for you automatically ('follow'), ask you for
    confirmation ('ask'), or just ignore them ('ignore').  Choosing
    'follow' also sets PERL_AUTOINSTALL and PERL_EXTUTILS_AUTOINSTALL for
    "--defaultdeps" if not already set.
    
    Please set your policy to one of the three values.
    
     <prerequisites_policy>
    Policy on building prerequisites (follow, ask or ignore)? [follow] follow
    ...
    

    但默认值是follow,你的输出显示它是否遵循依赖关系。

    【讨论】:

    • 好的,但是当我尝试执行 .pl 文件时,我得到:Can't locate Smart/Comments.pm in @INC (you may need to install the Smart::Comments module) (@INC contains: /beegfs/home/me/perl5/lib/perl5/x86_64-linux-thread-multi /beegfs/home/me/perl5/lib/perl5 /beegfs/data/me/myconda/lib/site_perl/5.26.2/x86_64-linux-thread-multi /beegfs/data/me/myconda/lib/site_perl/5.26.2 /beegfs/data/me/myconda/lib/5.26.2/x86_64-linux-thread-multi /beegfs/data/me/myconda/lib/5.26.2 .) at HmmCleaner.pl line 16. BEGIN failed--compilation aborted at HmmCleaner.pl line 16.
    • 请提供set | grep ^PERL; echo 'o conf' | cpan | grep -P '^\s*(make|mbuild)'; which cpan; head -n 1 "$( which cpan )"; which perl; cpan Smart::Comments; perl -e'use Smart::Comments'的输出(将其添加到您的问题中。)
    • 您添加的输出没有错误。 Smart::Comment 已成功安装和加载。如果您仍然收到来自HmmCleaner.pl 的错误,则说明您使用的是不同的perl 和/或不同的环境(如您所展示的那样没有设置PERL5LIB)。
    • 如何查看我使用的 perl5lib 环境而不是 /beegfs/home/me/perl5/lib/perl5?
    • 我们在上面使用了set | grep ^PERL,但echo "$PERL5LIB" 也可以解决问题。
    猜你喜欢
    • 2010-10-28
    • 1970-01-01
    • 2010-12-14
    • 1970-01-01
    • 2014-01-02
    • 2015-09-13
    • 2017-11-08
    • 2012-12-02
    • 1970-01-01
    相关资源
    最近更新 更多