无法在conda安装的程序中找到@INC中的File / Slurp.pm

问题描述 投票:1回答:1

我开始使用conda('abricate','mlst')安装的不同程序遇到麻烦,在@INC中无法找到File / Slurp.pm。这是在更换计算机并重新安装不同的东西并更改为anaconda3后发生的。作为示例,我在尝试启动abricate时收到以下错误消息:

Can't locate File/Slurp.pm in @INC (you may need to install the File::Slurp module) 
(@INC contains: /anaconda3/lib/perl5/site_perl/5.22.0/darwin-thread-multi-2level /anaconda3/lib/perl5/site_perl/5.22.0 /anaconda3/lib/perl5/5.22.0/darwin-thread-multi-2level /anaconda3/lib/perl5/5.22.0 .) at /anaconda3/bin/abricate line 9.
BEGIN failed--compilation aborted at /anaconda3/bin/abricate line 9.

当我在我的计算机上搜索安装时,它已经存在于多个位置(其中一些是空的?):

  • /anaconda3/派克公司/皮尔洛-file-slurp-9999.25-评论526_0/礼拜/site_皮尔洛/5.26.2/Darwin-thread-multi-2level/auto/file/slurp
  • /anaconda3/派克公司/皮尔洛-file-slurp-tiny-0.004-评论526_1/礼拜/site_皮尔洛/5.26.2/file/slurp
  • /anaconda3/派克公司/皮尔洛-file-slurp-tiny-0.004-评论526_1/礼拜/site_皮尔洛/5.26.2/Darwin-thread-multi-2level/auto/file/slurp
  • /anaconda3/礼拜/site_皮尔洛/5.26.2/Darwin-thread-multi-2level/auto/file/slurp
  • /anaconda3/礼拜/site_皮尔洛/5.26.2/file/slurp

我试图重新安装slurp模块

conda install -c bioconda perl-file-slurp

但这没有帮助。

我试图进一步了解how the @INC is build up。但我对如何使用conda安装的程序感到困惑。当我查看perl环境时,与为@INC指定不同文件夹的错误消息相比,我获得了不同的位置。

$ env -i perl -V

Summary of my perl5 (revision 5 version 18 subversion 2) configuration:

  Platform:
    osname=darwin, osvers=18.0, archname=darwin-thread-multi-2level
    uname='darwin osx337.sd.apple.com 18.0 darwin kernel version 17.0.0: fri may 4 10:33:38 pdt 2018; root:xnu-4570.1.46.100.2~1development_x86_64 x86_64 '
    config_args='-ds -e -Dprefix=/usr -Dccflags=-g  -pipe  -Dldflags= -Dman3ext=3pm -Duseithreads -Duseshrplib -Dinc_version_list=none -Dcc=cc'
    hint=recommended, useposix=true, d_sigaction=define
    useithreads=define, usemultiplicity=define
    useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef
    use64bitint=define, use64bitall=define, uselongdouble=undef
    usemymalloc=n, bincompat5005=undef
  Compiler:
    cc='cc', ccflags =' -g -pipe -fno-common -DPERL_DARWIN -fno-strict-aliasing -fstack-protector',
    optimize='-Os',
    cppflags='-g -pipe -fno-common -DPERL_DARWIN -fno-strict-aliasing -fstack-protector'
    ccversion='', gccversion='4.2.1 Compatible Apple LLVM 10.0.0 (clang-1000.0.42)', gccosandvers=''
    intsize=4, longsize=8, ptrsize=8, doublesize=8, byteorder=12345678
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16
    ivtype='long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
    alignbytes=8, prototype=define
  Linker and Libraries:
    ld='cc', ldflags =' -fstack-protector'
    libpth=/usr/lib /usr/local/lib
    libs= 
    perllibs=
    libc=, so=dylib, useshrplib=true, libperl=libperl.dylib
    gnulibc_version=''
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=bundle, d_dlsymun=undef, ccdlflags=' '
    cccdlflags=' ', lddlflags=' -bundle -undefined dynamic_lookup -fstack-protector'


Characteristics of this binary (from libperl): 
  Compile-time options: HAS_TIMES MULTIPLICITY PERLIO_LAYERS
                        PERL_DONT_CREATE_GVSV
                        PERL_HASH_FUNC_ONE_AT_A_TIME_HARD
                        PERL_IMPLICIT_CONTEXT PERL_MALLOC_WRAP
                        PERL_PRESERVE_IVUV PERL_SAWAMPERSAND USE_64_BIT_ALL
                        USE_64_BIT_INT USE_ITHREADS USE_LARGE_FILES
                        USE_LOCALE USE_LOCALE_COLLATE USE_LOCALE_CTYPE
                        USE_LOCALE_NUMERIC USE_PERLIO USE_PERL_ATOF
                        USE_REENTRANT_API
  Locally applied patches:
    /Library/Perl/Updates/<version> comes before system perl directories
    installprivlib and installarchlib points to the Updates directory
  Built under darwin
  Compiled at Aug 17 2018 17:29:08
  @INC:
    /Library/Perl/5.18/darwin-thread-multi-2level
    /Library/Perl/5.18
    /Network/Library/Perl/5.18/darwin-thread-multi-2level
    /Network/Library/Perl/5.18
    /Library/Perl/Updates/5.18.2
    /System/Library/Perl/5.18/darwin-thread-multi-2level
    /System/Library/Perl/5.18
    /System/Library/Perl/Extras/5.18/darwin-thread-multi-2level
    /System/Library/Perl/Extras/5.18
    .

我的路径如下:

$ echo $PATH
/anaconda3/bin:/anaconda3/condabin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/ncbi/blast/bin:/opt/X11/bin

我相信通过向程序本身添加内容也可以改变环境

use lib '/anaconda3/lib/site_perl/5.26.2/darwin-thread-multi-2level';

但是由于我遇到了多个程序的问题,我想了解核心问题是什么(除了我对这个很新... :)

perl conda perl-module
1个回答
1
投票

看起来你搞砸了你的系统。

如果我正确解释消息,您至少有三个不同的Perl安装:

  • 从macOS Mojave(?osvers=18.0)安装5.18.2
  • 来自anaconda3的5.22.0
  • 5.26.2来自anaconda3 ???? (或只是包,但不是perl二进制本身)

env -i CMD以空的环境启动CMD,因此它将删除您可能已配置的任何内容。因此,env -i perl -V将在您的系统中找到“默认”perl,这是来自/usr/bin/perl中macOS Mojave安装的perl。

但是perl不会导致错误消息,所以我们可以忽略它。


当你执行conda ...时,它似乎使用来自/anaconda3的perl 5.22.0。但与此同时,您已在该环境中安装了perl 5.26.2。我受过教育的猜测是:

  • 您安装/更新了Anaconda 3 perl软件包失败,即它已经安装了5.26.2软件包,但没有安装二进制文件并保留旧的perl 5.22.0二进制文件。
  • 你没有使用相同的频道进行不同的conda install运行(你的问题表明你想使用“bioconda”频道?)

所以你应该尝试的第一件事是在你运行conda的同一个终端:

$ which perl
$ perl -V

如何解决这个问题?以下是我要尝试的事情:

  • 尝试使用conda update -c bioconda perl更新Anaconda 3 perl包
  • 尝试删除并重新安装Anaconda3 perl软件包conda remove -c bioconda perlconda install -c bioconda perl
  • 激烈的方法:从头开始移除并重新安装Anaconda 3,即rm -rf /anaconda3,从PATH移除~/.bashrc添加,然后关闭终端。
© www.soinside.com 2019 - 2024. All rights reserved.