minGW 和 cpan 模块

发布于 2024-12-07 10:50:26 字数 3245 浏览 1 评论 0原文

我正在尝试使用 perl(ActiveState perl) 中的 Finance::TickerSymbols 模块,由于 PPM 没有它,所以我在 minGW 控制台上运行 cpan 来安装它。 安装很顺利,但是,minGW 似乎安装了模块

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

,所以当我运行我的 perl 代码时,我收到以下错误:

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

当然编译失败了。 我可以从 mingw 路径复制并粘贴 .pm,但这并不适用于所有情况。谁能建议如何解决这个问题。谢谢!

编辑:为其他模块运行安装以提供 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

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

(り薆情海 2024-12-14 10:50:26

您需要转到 PPM 并安装 CPAN 模块

然后,转到命令行并运行 cpan。然后安装Finance::TickerSymbols。 ActiveState 的 cpan 将检查您是否需要安装 MinGW,并在必要时安装它。之后,它将下载并构建 Finance::TickerSymbols 模块。

如果这不起作用,请在 Perl 脚本中使用 use lib pragma 来指定应从中加载这些模块的目录:

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

是的,没错,该模块实际上位于 /usr 中/lib/perl5.如果您查看输出,您会发现模块是在 C:\MinGW\msys\1.0\home\ar\.cpan\build\ 中构建的,但是如果您查看末尾日志中,您会看到它们被安装在 /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

您可以做的最后一件事(如果没有其他工作)是切换到 草莓 Perl。它附带了使用 CPAN 模块所需的一切。拉里·沃尔就是这么用的。 Strawberry Perl 从 CPAN 存档安装该模块没有任何问题。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文