-2

I am a newbie on Perl and I have a problem with the module Statitics::R.

I have to install a software (Sowhat:https://github.com/josephryan/sowhat) on a mac. For this I need Statistics::R. I downloaded it and put the compressed directory on my sowhat directory. After this I decompressed my directory and install my Module. I tried to install my software and then I obtained this answer

Error:

Can't locate Statistics/R.pm in @INC (you may need to install the Statistics::R module) (@INC contains: /Users/UMR7205/Documents/sowhat-master/blib/lib /Users/UMR7205/Documents/sowhat-master/blib/arch /Users/UMR7205/Documents/sowhat-master/blib/lib/Statistics-R0.34/lib/Statistics/R.pm /Users/UMR7205/Documents/sowhat-master/blib/lib/Statistics-R0.34/lib/Statistics/R.pm /Library/Perl/5.18/darwin-thread-multi-2level /Library/Perl/5.18 /Network/Library/Perl/5.18/darwin-thread-multi-2level /Network/Library/Perl/5.18 /Library/Perl/Updates/5.18.2 /System/Library/Perl/5.18/darwin-thread-multi-2level /System/Library/Perl/5.18 /System/Library/Perl/Extras/5.18/darwin-thread-multi-2level /System/Library/Perl/Extras/5.18 .) at (eval 4) line 2. BEGIN failed--compilation aborted at (eval 4) line 2.

But:

  • The directory which contains the Statistics/R.pm" is listed here
  • When I checked the installation of Statistics::R I have the same answer
  • I had no error message when I install the package

Could someone help me?

Raviteja
  • 3,399
  • 23
  • 42
  • 69
F.Thouzé
  • 1
  • 2
  • What are you doing? How did the ***file*** `/Users/UMR7205/Documents/sowhat-master/blib/lib/Statistics-R0.34/lib/Statistics/R.pm` get in to your `@INC`? That file is from your *build* directory. I am guessing you built the module using `make`, but did not do `make install` and instead thought you should put the file path in `@INC`. First, don't mess with the `perl` environment that comes with your OS. Compile your own `perl`. Second, after that install the module using one of the convenient utilities so all the dependencies also get installed. – Sinan Ünür Mar 18 '16 at 14:25
  • Also, FYI, if you have a module `My::Module` in `/some/path/here/or/there/My/Module.pm`, you need `/some/path/here/or/there` in your `@INC` for `perl` to find it, but you rarely have to do this ***if*** you avoid just throwing everything at a wall and see what sticks. Read [perldoc -f require](https://metacpan.org/pod/perlfunc#require-EXPR) for how `perl` looks for modules. – Sinan Ünür Mar 18 '16 at 14:28

2 Answers2

-1

if you have R installed it is enough to say sudo perl -MCPAN -e 'install Statistics::R' in terminal to install this package where it should be

sotona
  • 1,731
  • 2
  • 24
  • 34
  • [Don't mess with the system `perl`](http://www.effectiveperlprogramming.com/2015/11/apple-recommends-installing-your-own-perl/). – Sinan Ünür Mar 18 '16 at 14:21
-1

I belive you may need some configuration first. Please try to follow the step in this guide.

From http://triopter.com/archive/how-to-install-perl-modules-on-mac-os-x-in-4-easy-steps/

1) Make sure you have the Apple Developer Tools (XCode) installed.

2) Configure CPAN. $ sudo perl -MCPAN -e shell perl> o conf init

This will prompt you for some settings. You can accept the defaults for almost everything (just hit “return”). The two things you must fill in are the path to make (which should be /usr/bin/make or the value returned when you run which make from the command line) and your choice of CPAN mirrors (which you actually choose don’t really matter, but it won’t let you finish until you select at least one). If you use a proxy or a very restrictive firewall, you may have to configure those settings as well. If you skip Step 2, you may get errors about make being unavailable.

3) Upgrade CPAN $ sudo perl -MCPAN -e 'install Bundle::CPAN'

4) Install your modules. For each module…. $ sudo perl -MCPAN -e 'install Bundle::Name' or $ sudo perl -MCPAN -e 'install Module::Name'

Bolza
  • 1,904
  • 2
  • 17
  • 42
  • [Don't mess with the system `perl`](http://www.effectiveperlprogramming.com/2015/11/apple-recommends-installing-your-own-perl/). – Sinan Ünür Mar 18 '16 at 14:21