模块安装成功但找不到

Ham*_*ter 3 perl cpan perlbrew cpanm

我想知道为什么即使已经安装了依赖项,我也会收到“安装依赖项失败:未安装模块‘模块::名称’”。我正在使用perlbrewcpanm。以下是我尝试安装的许多模块所发生情况的示例:

  1. 我尝试安装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
Run Code Online (Sandbox Code Playgroud)
  1. 它告诉我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
Run Code Online (Sandbox Code Playgroud)
  1. 我回到我最初想要的,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
Run Code Online (Sandbox Code Playgroud)

谁能告诉我为什么会发生这种情况以及我能做些什么来阻止它?如果我遗漏了您需要的更多信息,请告诉我。

谢谢

Ham*_*ter 5

感谢/sf/users/141359081/

哈米德@caspian:~$ PERL_MM_OPT=""; PERL_MB_OPT="";

已经完成了工作:)

local::lib把事情搞砸了。URI.pm已安装但不在 perlbrew 目录下。

  • 如果您配置了 `local::lib`,您应该检查您的 `.bashrc` (或 shell 的等效项);`PERL_MM_OPT` 和 `PERL_MB_OPT` 可能在那里设置。 (2认同)