【发布时间】:2015-05-11 21:36:46
【问题描述】:
我想知道为什么我得到“安装依赖项失败:未安装模块'Module::Name'”即使已安装依赖项。我正在使用perlbrew 和cpanm。以下是我尝试安装的许多模块发生的情况的示例:
- 我尝试安装例如
URI::ws,如下所示
hamid@caspian:~$ /home/hamid/perl5/perlbrew/bin/cpanm --installdeps URI::ws --> Working on URI::ws Fetching http://www.cpan.org/authors/id/P/PL/PLICEASE/URI-ws-0.03.tar.gz ... OK Configuring URI-ws-0.03 ... OK ==> Found dependencies: URI --> Working on URI Fetching http://www.cpan.org/authors/id/E/ET/ETHER/URI-1.67.tar.gz ... OK Configuring URI-1.67 ... OK Building and testing URI-1.67 ... OK Successfully installed URI-1.67 ! Installing the dependencies failed: Module 'URI' is not installed ! Bailing out the installation for URI-ws-0.03. 1 distribution installed
- 它告诉我
URI没有安装。所以我安装URI如下:
hamid@caspian:~$ /home/hamid/perl5/perlbrew/bin/cpanm URI --> Working on URI Fetching http://www.cpan.org/authors/id/E/ET/ETHER/URI-1.67.tar.gz ... OK Configuring URI-1.67 ... OK Building and testing URI-1.67 ... OK Successfully installed URI-1.67 1 distribution installed
- 我回到我最初想要的
URI::ws,这就是我得到的:
hamid@caspian:~$ /home/hamid/perl5/perlbrew/bin/cpanm URI::ws --> Working on URI::ws Fetching http://www.cpan.org/authors/id/P/PL/PLICEASE/URI-ws-0.03.tar.gz ... OK Configuring URI-ws-0.03 ... OK ==> Found dependencies: URI --> Working on URI Fetching http://www.cpan.org/authors/id/E/ET/ETHER/URI-1.67.tar.gz ... OK Configuring URI-1.67 ... OK Building and testing URI-1.67 ... OK Successfully installed URI-1.67 ! Installing the dependencies failed: Module 'URI' is not installed ! Bailing out the installation for URI-ws-0.03. 1 distribution installed
谁能告诉我为什么会发生这种情况以及我可以做些什么来阻止它?如果您需要任何我遗漏的更多信息,请告诉我。
谢谢
【问题讨论】:
-
URI 安装在哪里?
cpanm是从哪里读到的? -
@choroba : hamid@caspian:~$ perl -MURI -e 'print $INC{"Time/HiRes.pm"}' 在 @INC 中找不到 URI.pm
-
您的
cpanm安装在一个奇怪的位置;它是否通过正确的perl运行? -
@friedo 让工作更顺利perlbrew 可以install its own
cpanm- 所以这可能没问题。如果您将自己的local::lib和像$PERL5LIB这样的环境变量与perlbrew 的环境混合使用,可能会造成干扰(当然可以使用local::lib环境“内部” perlbrew 和lib命令)。 @Hamster 是否为您的 perlbrew 使用的 perl 版本安装了 URI? (i.e. 是 perlbrew 目录层次结构中存在的文件)。 -
看起来它正在安装在某个地方:-) 设置好
PERLBREW_env vars 了吗?像PERL_CPANM_OPT、PERL_LOCAL_LIB_ROOT或PERL5LIB之类的东西出现在您的环境中可能会搞砸?