Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Installing modules in personal lib directory - Just canīt make it work

by Andre_br (Pilgrim)
on Nov 20, 2005 at 03:21 UTC ( [id://510182]=perlquestion: print w/replies, xml ) Need Help??

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

Hello my friends!

I know, I know, there are a lot of posts about that. But I donīt know why this setting seems to be impossible. I have tried just about it all! So, I dsperately need your help. I am stuck with this for hours already. I tryed setting the PERL5LIB before calling the CPAN shell:

export PERL5LIB=/home/mysite/perl-lib
and also setting this through CPANīs MyCOnfig.pm:
$CPAN::Config = { 'build_cache' => q[10], 'build_dir' => q[/home/mysite/.cpan/build], 'cache_metadata' => q[1], 'cpan_home' => q[/home/mysite/.cpan], 'cpan_version_check' => q[1], 'dontload_hash' => { }, 'ftp' => q[/usr/bin/ftp], 'ftp_proxy' => q[], 'getcwd' => q[cwd], 'gpg' => q[/usr/bin/gpg], 'gzip' => q[/bin/gzip], 'histfile' => q[/home/mysite/.cpan/histfile], 'histsize' => q[100], 'http_proxy' => q[], 'inactivity_timeout' => q[0], 'index_expire' => q[1], 'inhibit_startup_message' => q[0], 'keep_source_where' => q[/home/mysite/.cpan/sources], 'lynx' => q[/usr/bin/lynx], 'make' => q[/usr/bin/make], 'make_arg' => q[PREFIX=/home/mysite/perl-lib], 'make_install_arg' => q[PREFIX=/home/mysite/perl-lib], 'makepl_arg' => q[PREFIX=/home/mysite/perl-lib], 'ncftpget' => q[/usr/bin/ncftpget], 'no_proxy' => q[], 'pager' => q[/usr/bin/less], 'prerequisites_policy' => q[ask], 'scan_cache' => q[atstart], 'shell' => q[/bin/bash], 'tar' => q[/bin/tar], 'term_is_latin' => q[1], 'unzip' => q[/usr/bin/unzip], 'urllist' => [q[ftp://archive.progeny.com/CPAN/], q[ftp://carroll.ca +c.psu.edu/pub/CPAN/], q[ftp://cpan-du.viaverio.com/pub/CPAN/], q[ftp: +//cpan-sj.viaverio.com/pub/CPAN/], q[ftp://cpan.calvin.edu/pub/CPAN], + q[ftp://cpan.cs.utah.edu/pub/CPAN/], q[ftp://cpan.cse.msu.edu/], q[f +tp://cpan.erlbaum.net/], q[ftp://cpan.llarian.net/pub/CPAN/], q[ftp:/ +/cpan.mirrors.redwire.net/pub/CPAN/], q[ftp://cpan.mirrors.tds.net/pu +b/CPAN], q[ftp://cpan.netnitco.net/pub/mirrors/CPAN/], q[ftp://cpan.p +air.com/pub/CPAN/], q[ftp://cpan.teleglobe.net/pub/CPAN], q[ftp://cpa +n.thepirtgroup.com/], q[ftp://csociety-ftp.ecn.purdue.edu/pub/CPAN], +q[ftp://ftp-mirror.internap.com/pub/CPAN/], q[ftp://ftp.ccs.neu.edu/n +et/mirrors/ftp.funet.fi/pub/languages/perl/CPAN/], q[ftp://ftp.cise.u +fl.edu/pub/mirrors/CPAN/], q[ftp://ftp.cpanel.net/pub/CPAN/], q[ftp:/ +/ftp.cs.colorado.edu/pub/perl/CPAN/], q[ftp://ftp.dc.aleron.net/pub/C +PAN/], q[ftp://ftp.duke.edu/pub/perl/], q[ftp://ftp.epix.net/pub/lang +uages/perl/], q[ftp://ftp.mednor.net/pub/mirrors/CPAN/], q[ftp://ftp. +ncsu.edu/pub/mirror/CPAN/], q[ftp://ftp.osuosl.org/pub/CPAN/], q[ftp: +//ftp.rge.com/pub/languages/perl/], q[ftp://ftp.saintjoe.edu/pub/CPAN +], q[ftp://ftp.sunsite.utk.edu/pub/CPAN/], q[ftp://ftp.theshell.com/p +ub/CPAN/], q[ftp://ftp.uwsg.iu.edu/pub/perl/CPAN/], q[ftp://linux.cs. +lewisu.edu/pub/CPAN], q[ftp://mirror.candidhosting.com/pub/CPAN], q[f +tp://mirror.cc.columbia.edu/pub/software/cpan/], q[ftp://mirror.datap +ipe.net/pub/CPAN/], q[ftp://mirror.hiwaay.net/CPAN/], q[ftp://mirror. +sg.depaul.edu/pub/CPAN/], q[ftp://mirror.sit.wisc.edu/pub/CPAN/], q[f +tp://mirror.xmission.com/CPAN/], q[ftp://mirrors.ibiblio.org/pub/mirr +ors/CPAN], q[ftp://mirrors.jtlnet.com/CPAN/], q[ftp://mirrors.kernel. +org/pub/CPAN], q[ftp://mirrors.rcn.net/pub/lang/CPAN/], q[ftp://mirro +rs.phenominet.com/pub/CPAN/], q[ftp://perl.secsup.org/pub/perl/], q[h +ttp://cpan.belfry.net/], q[http://cpan.binarycompass.org], q[http://c +pan.mirrors.hoobly.com/], q[http://cpan.mirrors.nks.net/]], 'wget' => q[/usr/bin/wget], }; 1; __END__
And hereīs the complete transcript of the failed installation:
[mysite@myserver]$ PREFIX=/home/mysite/perl-lib perl -MCPAN -e shell cpan shell -- CPAN exploration and modules installation (v1.7601) ReadLine support enabled cpan> install Text::Language::Guess CPAN: Storable loaded ok Going to read /home/mysite/.cpan/Metadata Database was generated on Sat, 19 Nov 2005 10:50:27 GMT Running install for module Text::Language::Guess Running make for M/MS/MSCHILLI/Text-Language-Guess-0.01.tar.gz CPAN: Digest::MD5 loaded ok CPAN: Compress::Zlib loaded ok Checksum for /home/mysite/.cpan/sources/authors/id/M/MS/MSCHILLI/Text- +Language-Guess-0.01.tar.gz ok Scanning cache /home/mysite/.cpan/build for sizes Text-Language-Guess-0.01/ Text-Language-Guess-0.01/adm/ Text-Language-Guess-0.01/adm/podok Text-Language-Guess-0.01/t/ Text-Language-Guess-0.01/t/001Basic.t Text-Language-Guess-0.01/t/canned/ Text-Language-Guess-0.01/t/canned/en.txt Text-Language-Guess-0.01/t/canned/de.txt Text-Language-Guess-0.01/Makefile.PL Text-Language-Guess-0.01/MANIFEST.SKIP Text-Language-Guess-0.01/META.yml Text-Language-Guess-0.01/Changes Text-Language-Guess-0.01/lib/ Text-Language-Guess-0.01/lib/Text/ Text-Language-Guess-0.01/lib/Text/Language/ Text-Language-Guess-0.01/lib/Text/Language/Guess.pm Text-Language-Guess-0.01/eg/ Text-Language-Guess-0.01/eg/language-guess Text-Language-Guess-0.01/MANIFEST Removing previously used /home/mysite/.cpan/build/Text-Language-Guess- +0.01 CPAN.pm: Going to build M/MS/MSCHILLI/Text-Language-Guess-0.01.tar.g +z Checking if your kit is complete... Looks good Warning: prerequisite Text::ExtractWords 0 not found. Writing Makefile for Text::Language::Guess ---- Unsatisfied dependencies detected during [M/MS/MSCHILLI/Text-Lang +uage-Guess-0.01.tar.gz] ----- Text::ExtractWords Shall I follow them and prepend them to the queue of modules we are processing right now? [yes] Running make test Delayed until after prerequisites Running make install Delayed until after prerequisites Running install for module Text::ExtractWords Running make for H/HD/HDIAS/Text-ExtractWords-0.08.tar.gz Checksum for /home/mysite/.cpan/sources/authors/id/H/HD/HDIAS/Text-Ext +ractWords-0.08.tar.gz ok Text-ExtractWords-0.08/ Text-ExtractWords-0.08/t/ Text-ExtractWords-0.08/t/words_list.t Text-ExtractWords-0.08/t/words_count.t Text-ExtractWords-0.08/MANIFEST Text-ExtractWords-0.08/ExtractWords.pm Text-ExtractWords-0.08/Changes Text-ExtractWords-0.08/examples/ Text-ExtractWords-0.08/examples/extract.pl Text-ExtractWords-0.08/ExtractWords.xs Text-ExtractWords-0.08/README Text-ExtractWords-0.08/Makefile.PL Removing previously used /home/mysite/.cpan/build/Text-ExtractWords-0. +08 CPAN.pm: Going to build H/HD/HDIAS/Text-ExtractWords-0.08.tar.gz Checking if your kit is complete... Looks good Writing Makefile for Text::ExtractWords cp ExtractWords.pm blib/lib/Text/ExtractWords.pm AutoSplitting blib/lib/Text/ExtractWords.pm (blib/lib/auto/Text/Extrac +tWords) /usr/bin/perl /usr/share/perl/5.8/ExtUtils/xsubpp -typemap /usr/share +/perl/5.8/ExtUtils/typemap ExtractWords.xs > ExtractWords.xsc && mv +ExtractWords.xsc ExtractWords.c cc -c -D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS -DDEBIAN -fno-s +trict-aliasing -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSE +T_BITS=64 -O2 -DVERSION=\"0.08\" -DXS_VERSION=\"0.08\" -fPIC "-I/us +r/lib/perl/5.8/CORE" ExtractWords.c Running Mkbootstrap for Text::ExtractWords () chmod 644 ExtractWords.bs rm -f blib/arch/auto/Text/ExtractWords/ExtractWords.so LD_RUN_PATH="" cc -shared -L/usr/local/lib ExtractWords.o -o blib/ar +ch/auto/Text/ExtractWords/ExtractWords.so chmod 755 blib/arch/auto/Text/ExtractWords/ExtractWords.so cp ExtractWords.bs blib/arch/auto/Text/ExtractWords/ExtractWords.bs chmod 644 blib/arch/auto/Text/ExtractWords/ExtractWords.bs Manifying blib/man3/Text::ExtractWords.3pm /usr/bin/make PREFIX=/home/mysite/perl-lib -- OK Running make test PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-e" "test_h +arness(0, 'blib/lib', 'blib/arch')" t/*.t t/words_count....ok t/words_list.....ok All tests successful. Files=2, Tests=4, 1 wallclock secs ( 0.05 cusr + 0.02 csys = 0.07 C +PU) /usr/bin/make test -- OK Running make install Files found in blib/arch: installing files in blib/lib into architectu +re dependent library tree Writing /home/mysite/perl-lib/lib/perl/5.8.4/auto/Text/ExtractWords/.p +acklist Appending installation info to /home/mysite/perl-lib/lib/perl/5.8.4/pe +rllocal.pod /usr/bin/make install PREFIX=/home/mysite/perl-lib -- OK Running make for M/MS/MSCHILLI/Text-Language-Guess-0.01.tar.gz Is already unwrapped into directory /home/mysite/.cpan/build/Text-La +nguage-Guess-0.01 CPAN.pm: Going to build M/MS/MSCHILLI/Text-Language-Guess-0.01.tar.g +z cp lib/Text/Language/Guess.pm blib/lib/Text/Language/Guess.pm cp eg/language-guess blib/script/language-guess /usr/bin/perl "-MExtUtils::MY" -e "MY->fixin(shift)" blib/script/langu +age-guess Manifying blib/man1/language-guess.1p Manifying blib/man3/Text::Language::Guess.3pm lib/Text/Language/Guess.pm:244: Unmatched =back /usr/bin/make PREFIX=/home/mysite/perl-lib -- OK Running make test PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-e" "test_h +arness(0, 'blib/lib', 'blib/arch')" t/*.t t/001Basic....# Failed test (t/001Basic.t at line 10) # Tried to use 'Text::Language::Guess'. # Error: Can't locate Text/ExtractWords.pm in @INC (@INC contains +: /home/.necha/mysite/.cpan/build/Text-Language-Guess-0.01/blib/lib / +home/.necha/mysite/.cpan/build/Text-Language-Guess-0.01/blib/arch /ho +me/mysite/perl-lib/i386-linux-thread-multi /home/mysite/perl-lib/i386 +-linux-thread-multi /home/mysite/perl-lib /etc/perl /usr/local/lib/pe +rl/5.8.4 /usr/local/share/perl/5.8.4 /usr/lib/perl5 /usr/share/perl5 +/usr/lib/perl/5.8 /usr/share/perl/5.8 /usr/local/lib/site_perl . /etc +/perl /usr/local/lib/perl/5.8.4 /usr/local/share/perl/5.8.4 /usr/lib/ +perl5 /usr/share/perl5 /usr/lib/perl/5.8 /usr/share/perl/5.8 /usr/loc +al/lib/site_perl .) at /home/.necha/mysite/.cpan/build/Text-Language- +Guess-0.01/blib/lib/Text/Language/Guess.pm line 15. # BEGIN failed--compilation aborted at /home/.necha/mysite/.cpan/build +/Text-Language-Guess-0.01/blib/lib/Text/Language/Guess.pm line 15. # Compilation failed in require at (eval 1) line 2. t/001Basic....NOK 1Can't locate object method "new" via package "Text: +:Language::Guess" at t/001Basic.t line 18. # Looks like you planned 11 tests but only ran 1. # Looks like your test died just after 1. t/001Basic....dubious Test returned status 255 (wstat 65280, 0xff00) DIED. FAILED tests 1-11 Failed 11/11 tests, 0.00% okay Failed Test Stat Wstat Total Fail Failed List of Failed ---------------------------------------------------------------------- +--------------------------- t/001Basic.t 255 65280 11 21 190.91% 1-11 Failed 1/1 test scripts, 0.00% okay. 11/11 subtests failed, 0.00% okay +. make: *** [test_dynamic] Error 2 /usr/bin/make test -- NOT OK Running make install make test had returned bad status, won't install without force
Thanks a lot my friends! Youīre my only hope now.

Andre_br

Replies are listed 'Best First'.
Re: Installing modules in personal lib directory - Just canīt make it work
by Tanktalus (Canon) on Nov 20, 2005 at 03:48 UTC

    That's a lot of output. Might I recommend some readmore tags? I'm focusing on a couple of lines:

    Writing /home/mysite/perl-lib/lib/perl/5.8.4/auto/Text/ExtractWords/.p +acklist
    and
    # Error: Can't locate Text/ExtractWords.pm in @INC (@INC contains +: /home/.necha/mysite/.cpan/build/Text-Language-Guess-0.01/blib/lib / +home/.necha/mysite/.cpan/build/Text-Language-Guess-0.01/blib/arch /ho +me/mysite/perl-lib/i386-linux-thread-multi /home/mysite/perl-lib/i386 +-linux-thread-multi /home/mysite/perl-lib /etc/perl /usr/local/lib/pe +rl/5.8.4 /usr/local/share/perl/5.8.4 /usr/lib/perl5 /usr/share/perl5 +/usr/lib/perl/5.8 /usr/share/perl/5.8 /usr/local/lib/site_perl . /etc +/perl /usr/local/lib/perl/5.8.4 /usr/local/share/perl/5.8.4 /usr/lib/ +perl5 /usr/share/perl5 /usr/lib/perl/5.8 /usr/share/perl/5.8 /usr/loc +al/lib/site_perl .) at /home/.necha/mysite/.cpan/build/Text-Language- +Guess-0.01/blib/lib/Text/Language/Guess.pm line 15.
    From the latter line, we can see your PERL5LIB there as /home/mysite/perl-lib - which is what we expect. However, from the former line, we can see that we're actually installing to /home/mysite/perl-lib/lib/perl/5.8.4. Which is an annoying difference in thought between MakeMaker and perl. I know I've solved this before, but for some reason my employer's VPN server seems down, so I can't sneak in to take a peek. What I think it was, is that you just need to add "/lib" to your PERL5LIB:
    export PERL5LIB=/home/mysite/perl-lib/lib
    That said, I haven't tried this with CPAN - only when I have the tarballs already downloaded, and then I can make/make install quickly.

      Hey Tanktalus and Jesuashook,

      Thanks for the ideas, but it seems this isnīt supposed to end! Still doesnīt work. Same issue you have pointed, Tanktalus. The home/mysite/perl-lib/lib/perl/5.8.4 dir appears.

      I tryed to install at a /home/mysite/perllib2, to see it the "-" was the problem, like you pointed, J. But no changes.

      Iīm exausted, Itīs more than 2 am here, tomorrow I go on. If you can recall the workaround, please post here these days, ok, Tanktalus?

      Thanks a lot for the efforts

      Andre

        Ok, I finally got in - they had me locked out all day, and with work 3200km away, I couldn't just walk over and smack someone upside the head.

        I have an auto-install script which is not CPAN. I check our tarballs in to our version control system as-is, complete with licenses, etc., exactly as the module authors have given to CPAN. I just download and checkin. The auto-install script then does a few things:

        1. Sets PERL_MM_USE_DEFAULT to 1 and PERL5LIB to "$install_base/lib" - in your case, $install_base is /home/mysite/perl-lib, thus PERL5LIB will need to be /home/mysite/perl-lib/lib. (I actually use File::Spec so that this may actually work on Windows, but that's not relevant, so I'll skip any other such portability issues.)
        2. Untars all the tarballs.
        3. Finds any that don't have any unmet dependancies. Installs them.
          • Runs "$^X -I$install_base/lib Makefile.PL LIB=$install_base/lib PREFIX=$install_base". Looking at that now, I don't think the -I$install_base/lib part is required since it's already in PERL5LIB.
          • Runs "make install" (I don't bother with the tests - those are run manually by me before I check in)
          Repeat this step until all tarballs are installed (since now some of the dependancies that were unmet in the previous run may now be met).

        So it looks to me that I found some reason to set both PREFIX and LIB when creating the Makefile. So perhaps you should set both. Note that LIB is set to $PREFIX/lib, which makes things really straight-forward.

        Good luck!

Re: Installing modules in personal lib directory - Just canīt make it work
by vishi83 (Pilgrim) on Nov 20, 2005 at 05:40 UTC

    Hi Andre !!

    If you wanna install modules from CPAN to the lib directory of your choice, then i would suggest , install them manually without using the CPAN Shell...

    As, tantaklus mentioned, you can run the MakeFile.PL with PREFIX and lib. That would be better and avoids confusion.


    .. Ok, suppose you want to install a module , say HTML::Template from CPAN,

    download the tar.gz file from CPAN and extract it, then you do the following,

    perl Makefile.PL PREFIX=/home/andre INSTALLPRIVLIB=/home/andre/lib/per +l5 INSTALLSCRIPT=/home/andre/bin INSTALLSITELIB=/home/andre/l +ib/perl5/site_perl INSTALLBIN=/home/andre/bin INSTALLMAN1DIR= +/home/andre/lib/perl5/man INSTALLMAN3DIR=/home/andre/lib/perl5/m +an3 All these in a single line ..ok

    As far as i know, I had given these lines

    export PERL5LIB=/home/andre/lib
    in bashrc .. Then give
    source .bashrc so that the changes come to effect. Hope this is useful to you Andre !! If you find any other ways, do post it .. Am sure tantaklus too agrees to this..

    Thank you ppl !!
    vishi83

    A perl Script without 'strict' is like a House without Roof; Both are not Safe;
      Hey vishi83 and Tanktalus!

      As you suggested it myght work, Iīve given up installing through CPAN shell, and did it manually. And finally, it worked! Thanks a lot folks!

      Take care!

      André

A reply falls below the community's threshold of quality. You may see it by logging in.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://510182]
Approved by friedo
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (3)
As of 2024-04-20 04:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found