Search code examples
perlcpanperlbrewcpanm

Modules install successfully but cannot be found


I am wondering why I get "Installing the dependencies failed: Module 'Module::Name' is not installed" even when dependency is has been installed. I am using perlbrew and cpanm. Here is an example of what happens with many modules that I try to install:

  1. I try to install for example URI::ws as follow
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
  1. it tells me URI is not installed. So I install URI as follow:
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
  1. I go back to what I originally wanted which was URI::ws and here is what I get:
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

Can anyone tell me why this is happening and what I can do to stop it? If there is any more information that you need which I have missed please let me know.

Thank you


Solution

  • Thanks to https://stackoverflow.com/users/2019415/g-cito

    hamid@caspian:~$ PERL_MM_OPT=""; PERL_MB_OPT="";

    has done the job :)

    local::lib was messing stuff up. URI.pm was installed but not under the perlbrew directory.