简体   繁体   English

无法在/usC/share/perl/5.14/CPAN/FirstTime.pm找到@INC中的local / lib.pm

[英]Can't locate local/lib.pm in @INC at /usr/share/perl/5.14/CPAN/FirstTime.pm

I am trying to use Perl the first time on my system which is Ubuntu 12.04. 我试图在我的系统上第一次使用Perl,这是Ubuntu 12.04。 I have Perl v.5.14.2 installed. 我安装了Perl v.5.14.2。
I looked up how to install Perl modules , so I started as follows: 我查找了如何安装Perl模块 ,所以我开始如下:

$ perl -MCPAN -e shell

The wizard started configuring the environment as can be seen here: http://pastebin.com/5hn8vkb5 该向导开始配置环境,如下所示: http//pastebin.com/5hn8vkb5
Though, it stopped in the middle with the following error message: 虽然,它在中间停止,出现以下错误消息:

...

Checksum for /home/john/.cpan/sources/authors/id/A/AP/APEIRON/local-lib-1.008009.tar.gz ok
---- Unsatisfied dependencies detected during ----
----     APEIRON/local-lib-1.008009.tar.gz    ----
    ExtUtils::MakeMaker [build_requires]
Running make test
  Make had some problems, won't test
  Delayed until after prerequisites
Running make install
  Make had some problems, won't install
  Delayed until after prerequisites

Can't locate local/lib.pm in @INC (@INC contains:
    /home/john/perl5/lib/perl5
    /etc/perl
    /usr/local/lib/perl/5.14.2
    /usr/local/share/perl/5.14.2
    /usr/lib/perl5
    /usr/share/perl5
    /usr/lib/perl/5.14
    /usr/share/perl/5.14
    /usr/local/lib/site_perl
    /home/john/Desktop)
at /usr/share/perl/5.14/CPAN/FirstTime.pm line 1300.

What can I do to setup the Perl environment correctly on my Ubuntu installation? 如何在我的Ubuntu安装上正确设置Perl环境?


After interrupting the wizard and restarting it again, there is no error message anymore. 中断向导并再次重新启动后,不再出现错误消息。 How can I start the wizard again so I can choose here: 如何再次启动向导,以便我可以在此处选择:

What approach do you want? 你想要什么方法? (Choose 'local::lib', 'sudo' or 'manual') [local::lib] (选择'local :: lib','sudo'或'manual')[local :: lib]

You're missing local::lib , which is what you told CPAN shell to do. 你缺少local::lib ,这是你告诉CPAN shell要做的事情。

You can install it like so: 您可以像这样安装它:

sudo apt-get install liblocal-lib-perl

You might be able to start over by rm -rf -ing your ~/.cpan directory. 您可以通过rm -rf ~/.cpan目录重新开始。 AT YOUR OWN RISK 由您自担风险

However, I would recommend trying cpanminus instead of the old CPAN shell . 但是,我建议尝试使用cpanminus而不是旧的CPAN shell

sudo apt-get install cpanminus

The local namespace was for your own personal modules and wouldn't be found in CPAN. 本地命名空间用于您自己的个人模块,在CPAN中找不到。 This is something relatively new. 这是一个相对较新的东西。 At many sites, you might need CPAN modules not in the current version of Perl, or you need a newer version of a particular module. 在许多站点,您可能需要不在当前版本的Perl中的CPAN模块,或者您需要更新版本的特定模块。 However, you don't have write access to the standard location where CPAN modules are installed. 但是,您没有对安装了CPAN模块的标准位置的写访问权限。

What this is doing is installing these modules under the $HOME/perl5/lib/local directory where you'll be able to access them. 这样做是在$HOME/perl5/lib/local目录下安装这些模块,您可以在其中访问它们。 You would also need to setup a PERL5LIB environment variable (usually in your startup scripts), so Perl will check this directory when locating these modules. 您还需要设置PERL5LIB环境变量(通常在您的启动脚本中),因此Perl将在查找这些模块时检查此目录。

If you have sudo privileges, use that to install CPAN modules rather than trying this. 如果您有sudo权限,请使用它来安装CPAN模块而不是尝试此操作。 The following will install the Foo::Bar module into the standard module directory for you (and do any configuration as necessary): 以下将为您安装Foo::Bar模块到标准模块目录中(并根据需要进行任何配置):

$ sudo cpan install Foo::Bar

If CPAN needs to be configured, it will do that first. 如果需要配置CPAN,它将首先执行此操作。

There are complete directions on doing the local::lib install for modules on MetaCPAN . MetaCPAN上为模块执行local :: lib安装有完整的指示。 They're pretty clear. 他们很清楚。

Several New OS's force (like Redhat 7) force to check presence of local::lib in the perl version, actually its a good thing this enables to users to use CPAN and add,experiment and enjoy new modules to be used with the perl without waiting for sitewide installation (like a root user). 几个新操作系统的强制(如Redhat 7)强制检查perl版本中local :: lib的存在,实际上这是一件好事,它使用户能够使用CPAN并添加,试验和享受与perl一起使用的新模块等待全站安装(如root用户)。 By default local::lib looks for $HOME/perl5 dir where the user's local or downloaded modules are located. 默认情况下,local :: lib查找用户的本地或下载模块所在的$ HOME / perl5目录。 If you see this problem then you have to do following 如果您看到此问题,则必须执行以下操作

  1. sudo su - whatever_user_owns_perl sudo su - whatever_user_owns_perl
  2. whatever_perl_install_path/cpan install local::lib whatever_perl_install_path / cpan install local :: lib

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在@INC 中找不到 CPAN.pm(@INC 包含:/usr/local/lib/perl5 /usr/local/share/perl5 - Can't locate CPAN.pm in @INC (@INC contains: /usr/local/lib/perl5 /usr/local/share/perl5 Perl编译错误:“无法找到local / lib.pm” - Perl Compilation Error: “Can't locate local/lib.pm” 无法在./select中的@INC(@INC包含:/usr/local/lib/perl/5.14.2 / etc / perl /usr/local/share/perl/5.14.2…)中找到Connection.pm。 CGI在线 - Can't locate Connection.pm in @INC (@INC contains: /usr/local/lib/perl/5.14.2 /etc/perl /usr/local/share/perl/5.14.2 …) at ./select.cgi at line 无法在@INC 中找到 DBD/ODBC.pm(@INC 包含:/usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor。 ) - Can't locate DBD/ODBC.pm in @INC (@INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor.) 找不到@INC中的MIME / Types.pm…在/usr/local/share/perl/5.10.1/Dancer/MIME.pm第7行 - Can't locate MIME/Types.pm in @INC … at /usr/local/share/perl/5.10.1/Dancer/MIME.pm line 7 屏幕错误:在@INC 中找不到 local/lib.pm(您可能需要安装 local::lib 模块) - Screen error: Can't locate local/lib.pm in @INC (you may need to install the local::lib module) 无法在 @INC 中找到 Module/Build.pm(@INC 包含:/usr/local/lib64/perl5 - Can't locate Module/Build.pm in @INC (@INC contains: /usr/local/lib64/perl5 Heroku自动完成导致“找不到本地/lib.pm”错误 - Heroku Autocomplete causing “Can't locate local/lib.pm” Error Perl 在@INC 中找不到.pm - Perl Can't locate .pm in @INC 在INC中找不到* .pm - Can't locate *.pm in INC
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM