cianius
cianius

Reputation: 2412

module not found in @INC even though its listed

I am using the sRAP package in R, bioconductor. I get this error:

 > logVals<-RNA.norm(paste0( ResultsDirectory,batch,'_only'),      paste0(ResultsDirectory,'RPKM_logs'),ResultsDirectory)
Can't locate Compress/Raw/Zlib.pm in @INC (@INC contains:    /cluster/project8/vyp/cian/support/R/WriteXLS/Perl /home/sejjcmu/bin/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi/
Compress/Raw/Zlib.pm /home/sejjcmu/bin/Perl/Compress-Zlib-1.41/Zlib.pm /home/sejjcmu/bin/Perl/Compress-Zlib-1.41 /home/sejjcmu/bin/Perl/Compress-Raw-Zlib-2.068 /home/sejjcmu/bin /sh
are/apps/genomics/vcftools_0.1.8a/perl /usr/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/site_perl/5.8.8 /usr/lib/perl5/site_perl /usr/lib64/perl5/vendor_per
 l/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.8      /usr/lib/perl5/vendor_perl /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/5.8.8 .) at /cluster/pr
 oject8/vyp/cian/support/R/WriteXLS/Perl/Archive/Zip.pm line 9.

I dont know much about perl, so I don't understand why it says it cant locate this zlib.pm in @INC and then proceeds to list it. I did install that package and added it to PERL5LIB in my bashrc

EDIT: R version 3.1.2 (2014-10-31) -- "Pumpkin Helmet" perl, v5.8.8 built for x86_64-linux-thread-multi

What I've tried. Ive since changed the R function this calls, adding 'Perl I preamble/Compress/Raw', that didnt work.

Upvotes: 0

Views: 640

Answers (2)

Borodin
Borodin

Reputation: 126722

You have added /home/sejjcmu/bin/Perl/Compress-Zlib-1.41/Zlib.pm to your @INC array by putting it in your PERL5LIB environment variable. But @INC contains a list of paths to be searched, in a similar way to the PATH environment variable. As the message says, it "Can't locate Compress/Raw/Zlib.pm" in any of those directories, and that's because /home/sejjcmu/bin/Perl/Compress-Zlib-1.41/Zlib.pm isn't even a directory

You say you've installed the package, but no standard tool would have put the file in that location, so I believe you must have copied it, which is largely why you're having problems

If you want to put this module in /home/sejjcmu/bin/Perl then it should be installed at /home/sejjcmu/bin/Perl/Compress/Raw/Zlib.pm, and /home/sejjcmu/bin/Perl should be added to the @INC array

But you really shouldn't be copying Perl modules about by hand. You should use cpan or a similar tool to install the module correctly in the first place.

This is a dialogue you can use to correctly install Compress::Raw::Zlib into your custom library location

$ cpan

cpan shell -- CPAN exploration and modules installation (v2.11)
Enter 'h' for help.


cpan> o conf makepl_arg PREFIX=/home/sejjcmu/bin/Perl
cpan> install Compress::Raw::Zlib

Upvotes: 4

choroba
choroba

Reputation: 241738

PERL5LIB shouldn't contain individual modules, but the path to their root directory, i.e. /home/sejjcmu/bin/lib64/perl5/site_perl/5.8.8/ (the architecture part shouldn't be needed).

Upvotes: 1

Related Questions