无法识别 Perl 模块

Perl modules not recognized

我正在尝试 运行 unitas_1.7.8.pl,一个 bioinformatic software available here。重要的是,我过去曾多次在这台 ubuntu 机器上成功使用过该软件。现在当我 运行 命令

perl ~/scripts/unitas_1.7.0.pl -threads 24 -s homo_sapiens -i PCR_Primer_11_S11_L001_R1_001.trim.lng ...

我收到错误

Perl module LWP::Simple is not installed on this machine!
Perl module Archive::Extract (in core since 2007-07-07) is not installed on this machine!
Perl modules are available for download at http://www.cpan.org/

If you have CPAN installed try the following:
 cpan
 install Archive::Extract
 exit

If you are on MAC or UNIX you should run cpan with sudo:
 sudo cpan
 install Archive::Extract
 exit

我已经按照这些说明更新并重新安装了 cpan(即使我知道它应该没问题),没有出现明显的问题。自从我上次成功使用 unitas 以来,我唯一能想到的是服务器在一个月前硬重启了。

详情:

Distributor ID: Ubuntu
Description:    Ubuntu 20.04.2 LTS
Release:        20.04
Codename:       focal
$ cpan --version
Loading internal logger. Log::Log4perl recommended for better logging
/home/user/miniconda3/bin/cpan version 1.64 calling Getopt::Std::getopts (version 1.12 [paranoid]),
running under Perl version 5.30.3.
  [Now continuing due to backward compatibility and excessive paranoia.
   See 'perldoc Getopt::Std' about $Getopt::Std::STANDARD_HELP_VERSION.]
Nothing to install!

$ type -p perl; perl -M5.010 -e'say "$_: $ENV{$_}" for sort grep /^PERL/, keys(%ENV)'; echo 'o conf' | cpan
/home/stewart/miniconda3/bin/perl
[...]
    make               [/usr/bin/make]
    make_arg           []
    make_install_arg   []
    make_install_make_command [/usr/bin/make]
    makepl_arg         [INSTALLDIRS=site]
    mbuild_arg         []
    mbuild_install_arg []
    mbuild_install_build_command [./Build]
    mbuildpl_arg       [--installdirs site]
[...]
$ perl -MLWP::Simple -E 'say $INC{"LWP/Simple.pm"}'
Can't locate LWP/Simple.pm in @INC (you may need to install the LWP::Simple module) (@INC contains: /home/stewart/miniconda3/lib/site_perl/5.30.3/x86_64-linux-thread-multi /home/stewart/miniconda3/lib/site_perl/5.30.3 /home/stewart/miniconda3/lib/5.30.3/x86_64-linux-thread-multi /home/stewart/miniconda3/lib/5.30.3 .).
BEGIN failed--compilation aborted.
$ head -n 1 "$( type -p cpan )"
#!/home/stewart/miniconda3/bin/perl
$ perl -MLWP::Simple -e'print "ok\n"'
Can't locate LWP/Simple.pm in @INC (you may need to install the LWP::Simple module) (@INC contains: /home/stewart/miniconda3/lib/site_perl/5.30.3/x86_64-linux-thread-multi /home/stewart/miniconda3/lib/site_perl/5.30.3 /home/stewart/miniconda3/lib/5.30.3/x86_64-linux-thread-multi /home/stewart/miniconda3/lib/5.30.3 .).
BEGIN failed--compilation aborted.

LWP::Simple 和 Archive::Extract

的当前状态
$ sudo cpan install LWP::Simple
Loading internal logger. Log::Log4perl recommended for better logging
Reading '/root/.cpan/Metadata'
  Database was generated on Tue, 07 Sep 2021 08:55:47 GMT
LWP::Simple is up to date (6.56).
$ sudo cpan install Archive::Extract
Loading internal logger. Log::Log4perl recommended for better logging
Reading '/root/.cpan/Metadata'
  Database was generated on Tue, 07 Sep 2021 08:55:47 GMT
Archive::Extract is up to date (0.88).
$ sudo cpan LWP::Simple
Loading internal logger. Log::Log4perl recommended for better logging
Reading '/root/.cpan/Metadata'
  Database was generated on Tue, 07 Sep 2021 08:55:47 GMT
LWP::Simple is up to date (6.56).

如果您已经拥有 Miniconda,那么您应该在隔离环境中使用 Bioconda 频道进行安装。您从 conda 安装的 Perl 正在干扰您的系统 CPAN 模块:

conda create -n unitas -c bioconda unitas
conda activate unitas

unitas.pl -threads 24 -s homo_sapiens -i PCR_Primer_11_S11_L001_R1_001.trim.lng ...

conda deactivate

None 建议的解决方案对我有用,除了直接从另一个目录(已经安装了它)调用 perl。

/usr/bin/perl5.30.0 ~/scripts/unitas_1.7.0.pl ...

可能有一种方法可以切换使用 $PATH 调用此目录时使用的默认 perl,但我现在找到了这个解决方法。感谢大家的帮助。