listanand has asked for the wisdom of the Perl Monks concerning the following question:

Hello fellow monks,

This is something I really need your wisdom on, so please help. I have been running into some seemingly exotic errors while installing Perl modules. Here's the latest one.

I tried to install Lingua::Identify (for more details please see my earlier thread http://perlmonks.org/?node_id=842692) and it requires Class::Factory::Util which in turn required Module::Build. When I asked CPAN to automatically download and install these dependencies, what happened was that it downloaded and installed these dependencies in different subdirectories (of the directory pointed to by $PERL5LIB) and these were not present in @INC. Because of this, my module installation was not successful.

I had to manually cut+paste Module::Build to $PERL5LIB and then do the same with Class::Factory::Util and then install Lingua::Identify.

Any reasons why this could be happening?

I will appreciate any help on this. And also if there are any resources that explain module installation in detail (I have read the tutorials on this site), please do send them my way.

Many thanks.

Andy

  • Comment on (Never Ending) Module Installation Issues

Replies are listed 'Best First'.
Re: (Never Ending) Module Installation Issues
by ikegami (Patriarch) on Jun 03, 2010 at 22:41 UTC
    You need to tell it where you want modules installed if you want them installed in a different location than the one you specified when you compiled perl. For example, you can use
    perl Makefile.PL INSTALLBASE=~ make make test make install

    It's similar for Module::Build modules:

    perl Build.PL --install_base ~ ./Build ./Build test ./Build install

    You can configure cpan to do that.

    o conf makepl_arg 'INSTALLBASE=~' o conf mbuildpl_arg '--install_base ~' o conf commit # To use these settings in future sessions too.

    PERL5LIB should be set to ~/lib/perl5 for INSTALLBASE=~. You can specify LIB=... in addition to INSTALLBASE=... if you want to further specify where modules should be installed.

      I am trying to install DBI module right now. After I did the above, and tried to install DBI, I got the error:

      ERROR: Can't create '/usr/local/bin' Do not have write permissions on '/usr/local/bin'
      I tried to say 'o conf LIB=~' also (in addition to INSTALLBASE) but got the error:

      Warning: unknown configuration variable 'LIB=~'
      I have tried installing with local::lib also, but have had no success as you can see here : http://www.perlmonks.org/?node_id=785906

      Looking forward to more help !

      Thanks.

      Andy

        The INSTALLBASE wasn't used if you got that error. Maybe you're using an old version of the build tools. (I thought that gave a warning?) Try

        o conf makepl_arg 'PREFIX=~ LIB=~/lib/perl5'
Re: (Never Ending) Module Installation Issues
by Anonymous Monk on Jun 04, 2010 at 13:20 UTC