Linux Can';使用Perl在@INC中找不到DBI.pm

Linux Can';使用Perl在@INC中找不到DBI.pm,linux,perl,Linux,Perl,我是Perl新手,我安装了DBI模块,但当我尝试运行脚本时,出现以下错误: Can't locate DBI.pm in @INC (you may need to install the DBI module) (@INC contains: /usr/lib/x86_64-linux-gnu/perl5/5.20/DBI.pm /home/heisenberg/perl5/perlbrew/perls/perl-5.20.1/lib/site_perl/5.20.1/x86_

我是Perl新手,我安装了DBI模块,但当我尝试运行脚本时,出现以下错误:

Can't locate DBI.pm in @INC (you may need to install the DBI module) (@INC contains:
    /usr/lib/x86_64-linux-gnu/perl5/5.20/DBI.pm
    /home/heisenberg/perl5/perlbrew/perls/perl-5.20.1/lib/site_perl/5.20.1/x86_64-linux
    /home/heisenberg/perl5/perlbrew/perls/perl-5.20.1/lib/site_perl/5.20.1
    /home/heisenberg/perl5/perlbrew/perls/perl-5.20.1/lib/5.20.1/x86_64-linux
    /home/heisenberg/perl5/perlbrew/perls/perl-5.20.1/lib/5.20.1
    .
    ) at call_request.pl line 12.
[为便于阅读,增加了换行符]

我知道还有另一个主题与同一主题,但没有答案。我不知道我能做什么

我在linux上(ubutunu)

谢谢你的帮助

编辑:

输出:

perl est /home/heisenberg/perl5/perlbrew/perls/perl-5.20.1/bin/perl

cpan est /home/heisenberg/perl5/perlbrew/perls/perl-5.20.1/bin/cpan

#!/home/heisenberg/perl5/perlbrew/perls/perl-5.20.1/bin/perl
    eval 'exec /home/heisenberg/perl5/perlbrew/perls/perl-5.20.1/bin/perl -S $0 ${1+"$@"}'
    if $running_under_some_shell;

grep arg
    make_arg           []
    make_install_arg   []
    makepl_arg         [INSTALLDIRS=site]
    mbuild_arg         []
    mbuild_install_arg []
    mbuildpl_arg       [--installdirs site]

PERLBREW_PERL: perl-5.20.1
PERLBREW_VERSION: 0.73
PERLBREW_ROOT: /home/heisenberg/perl5/perlbrew
PERLBREW_MANPATH: /home/heisenberg/perl5/perlbrew/perls/perl-5.20.1/man
PERLBREW_HOME: /home/heisenberg/.perlbrew
PERLBREW_BASHRC_VERSION: 0.73
PERLBREW_PATH: /home/heisenberg/perl5/perlbrew/bin:/home/heisenberg/perl5/perlbrew/perls/perl-5.20.1/bin
PERL5LIB: /usr/lib/x86_64-linux-gnu/perl5/5.20/DBI.pm

您需要使用希望可用的
perl
安装DBI。你说你已经这么做了,但事实显然不是这样。通常情况下,您会执行以下操作,但可能您有一个混乱的系统

perlbrew use perl-5.20.1
cpan DBI
如果这不起作用,请将以下输出添加到您的问题中,并通过留下评论通知我您已完成此操作

perlbrew use perl-5.20.1
type perl
type cpan
head -n 3 "$( type -p cpan )"
echo "o conf" | cpan | grep arg
perl -E'say "$_: $ENV{$_}" for grep /^PERL/, keys %ENV'
PS-无论您如何将
/usr/lib/x86_64-linux-gnu/perl5/5.20/DBI.pm
添加到
@INC
都是错误的!摆脱它



这些问题是由su的使用引起的,这将导致使用系统
perl
而不是
perlbrew
-安装的
perl

,就像我说的,我已经安装了DBI模块。perl不同意。模块是否安装在不同的目录中?为什么在
@INC
中直接列出
.pm
文件?为什么在
@INC
中有
/5.20/
/5.20.1/
?您是否为Perl 5.20安装了DBI,升级到5.20.1,然后尝试将旧的DBI.pm破解到您的
@INC
安装中,以便为新的Perl正确安装它?我不知道@Quentin!我用cpan安装了DBI,命令行install DBI对于最后一个perl-MDBI-e1,它的输出与我的错误
PERL5LIB
应该取消设置的输出相同,但它不会造成任何伤害。糟糕的路径会被忽略。很抱歉有这么多问题,但这是因为一切看起来都是对的!还有一个:
find/home/heisenberg/perl5/perlbrew/perls/perl-5.20.1-名称为'DBI.pm'
运行
cpan
可以看到它是毫无意义的,但是同样的
perl
不能看到它。对于查找,没有输出。。是的,看起来不错,但总是有这个错误^所以它没有安装,但是
cpan
说它是?!?!我不知道,但我认为您应该能够使用
perl-MCPAN-e'install DBI'安装它。