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:
URI::ws as followhamid@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 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
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
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.
With perlbrew you can install a perlbrew specific cpanm which facilitates installing to the various perls/ that are installed/managed using the perlbrew tool. I have found that this works very well.
However perlbrew can become confused if you mix in your own local::lib and set related environment variables like PERL5LIB, PERL_MM_OPT, PERL_MB_OPT etc. (see for example the post by @cjm in perlbrew and local::lib at the same time?). Some of these environment vars can interact and interfere with perlbrew's own environment so it's generally best to avoid mixing them or simply to let perlbrew manage the environment using its own versions of those variables.
It is of course possible to use local::lib environments "inside" perlbrew with the lib command) and to do very complicated things for testing with different perl versions, shipping an application with requirements (c.f. Carton). In my own environment I was able to manage system perl; a user installed local::lib that used the system perl; and a huge set of perlbrew perls all with judicious use of environment variables (thankfully a temporary set up while migrating between versions).
That sort of set up can get complicated very quickly, and is difficult to replicate. One of the greatest advantages of perlbrew is you can easily setup matching perl environments on multiple machines; or different perl environments on the same machine.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With