1

I am trying to use the Finance::TickerSymbols module from perl(ActiveState perl) and since PPM didn't have it, I ran cpan on my minGW console to install it. the installation went fine, however, minGW seems to install the modules in

C:\MinGW\msys\1.0\home\ar\.cpan\build\Finance-TickerSymbols-1.03\lib\Finance\

so, when I run my perl code, I get the following error:

Can't locate Finance/TickerSymbols.pm in @INC(@INC contains C:/Perl64/site/lib C:/Perl64/lib .)

and of course the compilation fails. I can copy and paste the .pm from the mingw path, but that's not going to work for everything. Can anyone suggest how this can be fixed. thx!

EDIT: ran install for other module to provide the output of install in minGW

Running install for module Finance::Curency::Convert
    Running make for J/JA/JANW/Finance-Currency-Convert-1.08.tgz
    CPAN: LWP::UserAgent loaded ok
    Fetching with LWP:
    ftp://ftp.perl.org/pub/CPAN/authors/id/J/JA/JANW/CHECKSUMS
    CPAN: Compress::Zlib loaded ok
    Checksum for /home/ar/.cpan/sources/authors/id/J/JA/JANW/Finance-Currency-Convert-1.08.tgz ok
    Scanning cache /home/ar/.cpan/build for sizes
    Deleting from cache: /home/ar/.cpan/build/GD-2.46 <24.0>10.0 MB>
    Deleting from cache: /home/ar/.cpan/build/Finance-TickerSymbols-1.03 <23.5>10.0 MB>
    Deleting from cache: /home/ar/.cpan/build/GDTextUtil-0.86 <23.4>10.0 MB>
    Deleting from cache: /home/ar/.cpan/build/GDGraph-1.44 <23.2>10.0 MB>
    Deleting from cache: /home/ar/.cpan/build/Date-Simple-3.03 <22.6>10.0 MB>
    Deleting from cache: /home/ar/.cpan/build/HTML-TableExtract-2.11 <22.4>10.0 MB>
    Deleting from cache: /home/ar/.cpan/build/Text-CSV-1.21 <22.2>10.0 MB>
    Deleting from cache: /home/ar/.cpan/build/ExtUtils-MakeMaker-6.59 <21.9>10.0 MB>
    Deleting from cache: /home/ar/.cpan/build/YAML-Syck-1.17 <19.1>10.0 MB>
    Deleting from cache: /home/ar/.cpan/build/Test-Inter-1.03 <18.2>10.0 MB>
    Deleting from cache: /home/ar/.cpan/build/Date-Manip-6.25 <18.0>10.0 MB>
    Finance-Currency-Convert-1.08/
    Finance-Currency-Convert-1.08/MANIFEST
    Finance-Currency-Convert-1.08/t/
    Finance-Currency-Convert-1.08/t/convert.t
    Finance-Currency-Convert-1.08/Makefile.PL
    Finance-Currency-Convert-1.08/Changes
    Finance-Currency-Convert-1.08/META.yml
    Finance-Currency-Convert-1.08/Convert.pm
    CPAN.pm: Going to build J/JA/JANW/Finance-Currency-Convert-1.08.tgz
    Checking if your kit is complete...
    Looks good
    Writing Makefile for Finance::Currency::Convert
    cp Convert.pm blib/lib/Finance/Currency/Convert.pm
    Autosplitting blib/lib/Finance/Currency/Convert.pm (blib/lib/auto/Finance/Currency/Convert)
    /bin/make -- OK
    Running make test
    /usr/bin/perl.exe "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib','blib/arch')"t/*.txt
    t/convert....ok
    All tests successful.
    Files=1, Tests=8, 0 wallclock secs ( 0.03 cusr + 0.03 csys = 0.06 CPU)
    /bin/make/test --OK
    Running make install
    Installing /usr/lib/perl5/site_perl/5.8/auto/Finance/Currency/Convert/autosplit.ix
    Installing /usr/lib/perl5/site_perl/5.8/auto/Finance/Currency/Convert.pm
    Writing /usr/lib/perl5/site_perl/5.8/auto/Finance/Currency/Convert/.packlist
    Appending installation info to /usr/lib/perl5/5.8/msys/perllocal.pod
    /bin/make/install -- OK
itcplpl
  • 780
  • 4
  • 18
  • 29
  • It's not the best fix, but you can modify `@INC` in your perl script before you `use` the offending package. – jswolf19 Oct 03 '11 at 03:42
  • I think that's just a temporary location used when building the module, so it looks like it didn't install (if that's the only place it is on your system). You might want to try running CPAN from a normal command window to install. – Alex Oct 03 '11 at 03:57
  • @jswolf19, you mean to include the minGW location – itcplpl Oct 03 '11 at 04:04
  • @Alex, yes, that's the only place, and it didn't give any error messages when I ran the install. when you say normal command window, you mean running it through windows cmd. – itcplpl Oct 03 '11 at 04:07
  • No, I think that's *not* an install directory. That appears to be a temporary *build* directory it's free to delete at any time. – ikegami Oct 03 '11 at 04:16
  • mingw doesn't install modules. It's used by installers such as ExtUtils::MakeMaker and Module::Build to compile the C components of modules. – ikegami Oct 03 '11 at 04:17
  • 2
    Since you have installation problems, perhaps you should copy down exactly what you did. – ikegami Oct 03 '11 at 04:18
  • @ikegami, first I installed minGW, and then I installed and built dmake 4.11. following that I ran cpan in my minGW console, and selected the auto configuration. when the cpan prompt came up, I typed install Finance::TickerSymbols, and the install went ok. then I tried to compile my perl program which is when I got the error message and when I looked in my Perl64 directory, obviously the file was not there. have i missed any steps. if so, please let me know. thx! – itcplpl Oct 03 '11 at 15:27
  • 1
    @itcplpl, Saying it "went ok" is completely unhelpful since it obviously didn't. My only guess from what you gave is that MinGW installed its own Perl and you installed the module for that Perl. Install it again, and give the output, please? You might have to `force get Finance::TickerSymbols` (from the `cpan` shell) before doing `install Finance::TickerSymbols` to safely convince it to reinstall a module that's already installed. – ikegami Oct 03 '11 at 17:37
  • @ikegami, I had to install another module also, so instead of force getting, I installed the Finance::Currency::Convert module and I have the same problem with it. I have edited the post with the output of the install. – itcplpl Oct 03 '11 at 18:47

1 Answers1

1

You need to go to the PPM and install the CPAN module.

Then, go to your command line, and run cpan. Then install Finance::TickerSymbols. ActiveState's cpan will check whether or not you need MinGW installed, and install it if necessary. After that, it will download and build the Finance::TickerSymbols module.

If that doesn't work, use the use lib pragma in your Perl script to specify the directory where these modules should be loaded from:

use lib qw(/usr/lib/perl5/5.8 /usr/lib/perl5/site_perl/5.8);

Yes, that's right, the module is actually in /usr/lib/perl5. If you look at your output, you'll see that the modules are built in C:\MinGW\msys\1.0\home\ar\.cpan\build\, but if you look at the end of the log, you'll see they're being installed in /usr/lib/perl5/site_perl/5.8

Running make install
Installing /usr/lib/perl5/site_perl/5.8/auto/Finance/Currency/Convert/autosplit.ix
Installing /usr/lib/perl5/site_perl/5.8/auto/Finance/Currency/Convert.pm
Writing /usr/lib/perl5/site_perl/5.8/auto/Finance/Currency/Convert/.packlist
Appending installation info to /usr/lib/perl5/5.8/msys/perllocal.pod
/bin/make/install -- OK

The final thing you can do (if nothing else works) is switch to Strawberry Perl. This comes with everything you need to use the CPAN modules. It's what Larry Wall uses. Strawberry Perl has no trouble installing that module from the CPAN archive.

David W.
  • 105,218
  • 39
  • 216
  • 337
  • I had CPAN, CPAN-Meta and CPAN-Meta-YAML installed (through PPM) before I installed minGW, which is why when I ran cpan from Windows cmd, it required me to install minGW. I just ran install from my windows cmd (not minGW) and it seems to have worked now. so, does that mean, for the future, should I be using cpan on Windows cmd and not minGW? – itcplpl Oct 03 '11 at 20:01
  • 1
    @itcplpl: Yes. Simply run `cpan` from the Windows console under the cmd.exe shell. If needed, it will install MinGW, and then continue installing the package. The problem is that MinGW is installing it in `/usr/lib/perl` which is where I believe Perl libraries are located in Linux. However, it is not where ActivePerl is looking for them. – David W. Oct 04 '11 at 20:42