首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何从没有安装bioperl的anaconda中修复Perl?“为BioPerl-1.007002提供安装包”

如何从没有安装bioperl的anaconda中修复Perl?“为BioPerl-1.007002提供安装包”
EN

Stack Overflow用户
提问于 2019-10-08 16:09:36
回答 1查看 3.2K关注 0票数 2

我正在使用conda安装几个软件包。我已经在conda下安装了Perl,并且在这台机器上工作(运行Ubuntu18.04)。现在我正在尝试使用一个需要bioperl的脚本。

我试图更新conda,通过conda安装bioperl,通过cpanm安装bioperl,如下所示。

我检查了当前使用的Perl是anaconda。perl脚本中的shebang是#!/home/evo-slave/anaconda_ete/bin/perl -w

这是运行脚本时的初始错误

代码语言:javascript
复制
    Can't locate Bio/SeqIO.pm in @INC (you may need to install the 
    Bio::SeqIO module) (@INC contains: /home/evo- 
    slave/anaconda_ete/lib/site_perl/5.26.2/x86_64-linux-thread-multi 
    /home/evo-slave/anaconda_ete/lib/site_perl/5.26.2 /home/evo- 
    slave/anaconda_ete/lib/5.26.2/x86_64-linux-thread-multi /home/evo- 
    slave/anaconda_ete/lib/5.26.2 .) at ./cortador.pl line 9.
    BEGIN failed--compilation aborted at ./cortador.pl line 9.

我不知道这是bioperl没有被anaconda perl调用/安装的问题,还是在执行脚本的过程中,也许脚本中的这行应该指明其他什么。

代码语言:javascript
复制
    use File::Basename;
    use Bio::SeqIO;
    use Bio::Seq;
    use Bio::DB::SeqFeature::Store;
    use Bio::SeqFeatureI;

当我试图安装

代码语言:javascript
复制
    cpanm Bio::Perl

我犯了这个错误

代码语言:javascript
复制
    --> Working on Bio::Perl
    Fetching http://www.cpan.org/authors/id/C/CJ/CJFIELDS/BioPerl- 
    1.007002.tar.gz ... OK
    Configuring BioPerl-1.007002 ... OK
    ==> Found dependencies: IO::String, Data::Stag, Test::Most
    --> Working on IO::String
    Fetching http://www.cpan.org/authors/id/G/GA/GAAS/IO-String-

    1.08.tar.gz ... OK
    Configuring IO-String-1.08 ... OK
    Building and testing IO-String-1.08 ... OK
    Successfully installed IO-String-1.08
    --> Working on Data::Stag
    Fetching http://www.cpan.org/authors/id/C/CM/CMUNGALL/Data-Stag- 
    0.14.tar.gz ... OK
    Configuring Data-Stag-0.14 ... OK
    ==> Found dependencies: IO::String
    ! Installing the dependencies failed: Module 'IO::String' is not 
    installed
    ! Bailing out the installation for Data-Stag-0.14.
    --> Working on Test::Most
    Fetching http://www.cpan.org/authors/id/O/OV/OVID/Test-Most- 
    0.35.tar.gz ... OK
    Configuring Test-Most-0.35 ... OK
    ==> Found dependencies: Test::Warn, Test::Deep, Test::Differences, 
    Test::Exception, Exception::Class
    --> Working on Test::Warn
    Fetching http://www.cpan.org/authors/id/B/BI/BIGJ/Test-Warn- 
    0.36.tar.gz ... OK
    Configuring Test-Warn-0.36 ... OK
    ==> Found dependencies: Sub::Uplevel
    --> Working on Sub::Uplevel
    Fetching http://www.cpan.org/authors/id/D/DA/DAGOLDEN/Sub-Uplevel- 
    0.2800.tar.gz ... OK
    Configuring Sub-Uplevel-0.2800 ... OK
    Building and testing Sub-Uplevel-0.2800 ... OK
    Successfully installed Sub-Uplevel-0.2800
    ! Installing the dependencies failed: Module 'Sub::Uplevel' is not 
    installed
    ! Bailing out the installation for Test-Warn-0.36.
    --> Working on Test::Deep
    Fetching http://www.cpan.org/authors/id/R/RJ/RJBS/Test-Deep- 
    1.128.tar.gz ... OK
    Configuring Test-Deep-1.128 ... OK
    Building and testing Test-Deep-1.128 ... OK
    Successfully installed Test-Deep-1.128
    --> Working on Test::Differences
    Fetching http://www.cpan.org/authors/id/D/DC/DCANTRELL/Test- 
    Differences-0.67.tar.gz ... OK
    Configuring Test-Differences-0.67 ... OK
    ==> Found dependencies: Capture::Tiny, Text::Diff
    --> Working on Capture::Tiny
    Fetching http://www.cpan.org/authors/id/D/DA/DAGOLDEN/Capture- 
    Tiny-0.48.tar.gz ... OK
    Configuring Capture-Tiny-0.48 ... OK
    Building and testing Capture-Tiny-0.48 ... OK
    Successfully installed Capture-Tiny-0.48
    --> Working on Text::Diff
    Fetching http://www.cpan.org/authors/id/N/NE/NEILB/Text-Diff- 
    1.45.tar.gz ... OK
    Configuring Text-Diff-1.45 ... OK
    ==> Found dependencies: Algorithm::Diff
    --> Working on Algorithm::Diff
    Fetching http://www.cpan.org/authors/id/T/TY/TYEMQ/Algorithm-Diff- 
    1.1903.tar.gz ... OK
    Configuring Algorithm-Diff-1.1903 ... OK
    Building and testing Algorithm-Diff-1.1903 ... OK
    Successfully installed Algorithm-Diff-1.1903
    ! Installing the dependencies failed: Module 'Algorithm::Diff' is 
     not installed
    ! Bailing out the installation for Text-Diff-1.45.
    ! Installing the dependencies failed: Module 'Text::Diff' is not 
    installed, Module 'Capture::Tiny' is not installed
    ! Bailing out the installation for Test-Differences-0.67.
    --> Working on Test::Exception
    Fetching http://www.cpan.org/authors/id/E/EX/EXODIST/Test- 
    Exception-0.43.tar.gz ... OK
    Configuring Test-Exception-0.43 ... OK
    ==> Found dependencies: Sub::Uplevel
    ! Installing the dependencies failed: Module 'Sub::Uplevel' is not 
    installed
    ! Bailing out the installation for Test-Exception-0.43.
    --> Working on Exception::Class
    Fetching http://www.cpan.org/authors/id/D/DR/DROLSKY/Exception- 
    Class-1.44.tar.gz ... OK
    Configuring Exception-Class-1.44 ... OK
    ==> Found dependencies: Class::Data::Inheritable
    --> Working on Class::Data::Inheritable
    Fetching http://www.cpan.org/authors/id/T/TM/TMTM/Class-Data- 
    Inheritable-0.08.tar.gz ... OK
    Configuring Class-Data-Inheritable-0.08 ... OK
    Building and testing Class-Data-Inheritable-0.08 ... OK
    Successfully installed Class-Data-Inheritable-0.08
    ! Installing the dependencies failed: Module 
    'Class::Data::Inheritable' is not installed
    ! Bailing out the installation for Exception-Class-1.44.
    ! Installing the dependencies failed: Module 'Test::Exception' is 
    not installed, Module 'Test::Differences' is not installed, Module 
    'Exception::Class' is not installed, Module 'Test::Warn' is not 
    installed, Module 'Test::Deep' is not installed
    ! Bailing out the installation for Test-Most-0.35.
    ! Installing the dependencies failed: Module 'Test::Most' is not 
    installed, Module 'IO::String' is not installed, Module 
    'Data::Stag' 
    is not installed
    ! Bailing out the installation for BioPerl-1.007002.
    6 distributions installed

ETA:似乎出了问题,在一个简单的cpanm示例中,没有安装所需模块的依赖项,而是尝试安装所需的所有内容。

代码语言:javascript
复制
    cpanm Sub::Uplevel

    --> Working on Sub::Uplevel
    Fetching http://www.cpan.org/authors/id/D/DA/DAGOLDEN/Sub-Uplevel-0.2800.tar.gz ... OK
    Configuring Sub-Uplevel-0.2800 ... OK
    Building and testing Sub-Uplevel-0.2800 ... OK
    Successfully installed Sub-Uplevel-0.2800
    1 distribution installed

然后

代码语言:javascript
复制
    cpanm Test::Warn

    --> Working on Test::Warn
    Fetching http://www.cpan.org/authors/id/B/BI/BIGJ/Test-Warn-0.36.tar.gz ... OK
    Configuring Test-Warn-0.36 ... OK
    ==> Found dependencies: Sub::Uplevel
    --> Working on Sub::Uplevel
    Fetching http://www.cpan.org/authors/id/D/DA/DAGOLDEN/Sub-Uplevel-0.2800.tar.gz ... OK
    Configuring Sub-Uplevel-0.2800 ... OK
    Building and testing Sub-Uplevel-0.2800 ... OK
    Successfully installed Sub-Uplevel-0.2800
    ! Installing the dependencies failed: Module 'Sub::Uplevel' is not installed
    ! Bailing out the installation for Test-Warn-0.36.
    1 distribution installed

一些帮助调试的信息:

代码语言:javascript
复制
$ set | grep ^PERL
PERL5LIB=:/media/evo-slave/Disco2/ANDRES/DOWNLOADS/GENOME/CAV-POC/GAAS/annotation
PERL_MB_OPT='--install_base "/home/evo-slave/perl5"'
PERL_MM_OPT=INSTALL_BASE=/home/evo-slave/perl5

$ which cpanm
/home/evo-slave/anaconda_ete/bin/cpanm

$ head -n 1 "$( which cpanm )"
#!/home/evo-slave/anaconda_ete/bin/perl
EN

回答 1

Stack Overflow用户

发布于 2020-06-01 21:28:00

更新2

这个问题在miniconda3 bioperl安装中再次出现。

更新

对于perl包,我已经有一段时间没有遇到这个错误了,因此很可能在修复这个错误的conda/package端发生了一些更新。我建议您尝试更新您的conda并检查您的conda频道,然后再尝试这种奇怪的方法。

原始答案

我将此作为一个答案,并不是因为这是一个好主意,而是因为它提供了更多的信息。我在Amazon上工作,所以它略有不同,但也遇到了通过conda安装的bioperl依赖项的问题。在我的例子中,我试图运行VirSorter,它提到了这个问题,并提出了一个不适用于我的解决方案,但建议确认您的PERL5LIB已被正确设置。

我注意到我的perl是5.26.2:

代码语言:javascript
复制
$ perl --version

This is perl 5, version 26, subversion 2 (v5.26.2) built for x86_64-linux-thread-multi

但是conda是出于某种原因安装了5.22.0的perl依赖项:/home/ec2-user/anaconda3/envs/virsorter/lib/perl5/site_perl/5.22.0/

代码语言:javascript
复制
$ ls /home/ec2-user/anaconda3/envs/virsorter/lib/perl5/site_perl/5.22.0/
Algorithm  Bio  Capture  Class  Data  Devel  Exception  IO  Sub  Test  Text  URI  URI.pm  x86_64-linux-thread-multi

我发现,只要简单地将VirSorter设置为conda下的5.22.0lib,就可以运行PERL5LIB,这显然是成功的:

代码语言:javascript
复制
OLD_PER5LIB=$PERL5LIB
export PERL5LIB=/home/ec2-user/anaconda3/envs/virsorter/lib/perl5/site_perl/5.22.0/
# run virsorter
# no errors!

我确信,这会为perl人员发出一堆危险信号,而且我确信,如果它真的有效的话,它是非常脆弱的。也许问题是为什么conda将perl模块安装为错误的perl版本?

票数 4
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/58290190

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档