Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Installing modules

by slugger415 (Monk)
on Jun 17, 2013 at 22:32 UTC ( [id://1039481]=perlquestion: print w/replies, xml ) Need Help??

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

Hello Perl wise ones, forgive me if I'm having my usual frustration with installing Perl modules on Windows XP with ActiveState. I specifically want to install DBD::JDBC.

  • I don't see it in the list when running ppm, and "ppm install DBD-JDBC" doesn't find it.
    ppm install DBD-JDBC ppm install failed: Can't find any package that provides DBD-JDBC
  • I also tried installing DBD::ODBC and got an "authorization required" error, but I don't know where to "authorize."
    ERROR: 401 Authorization Required
  • I tried adding cpan to the repository list in ppm (http://www.cpan.org) but zero modules are added.
  • I tried installing with cpan. I get dozens of errors, including a C Compiler not being installed. Just running "cpan" gives me this:
    It looks like you don't have a C compiler and make utility installed. + Trying to install dmake and the MinGW gcc compiler using the Perl Package Man +ager. This may take a a few minutes... Downloading MinGW-5.1.4.1...redirect Downloading MinGW-5.1.4.1...failed 401 Authorization Required ppm.bat install failed: 401 Authorization Required It looks like the installation of dmake and MinGW has failed. You wil +l not be able to run Makefile commands or compile C extension code. Please che +ck your internet connection and your proxy settings! cpan shell -- CPAN exploration and modules installation (v1.9402) Enter 'h' for help.
  • I looked at the instructions for installing modules on cpan.org which says you need a C compiler: "(it's easy to get this setup - don't panic), see your OS of choice below to find out how to get the right compiler." ... but couldn't find any instructions on how to install this.

Perhaps this is all related to the authorization error? Any idea how I can get running here?

Thank you as always...

Replies are listed 'Best First'.
Re: Installing modules
by dasgar (Priest) on Jun 18, 2013 at 01:29 UTC

    By default, ActiveState does not include a compiler and compiler tools with their ActivePerl installation. As such, you can only install pure Perl modules from CPAN and not those modules that need to be compiled (such as XS modules).

    I'm going to assume that you're using a 32-bit version of ActiveState's ActivePerl. Here's what I would recommend trying. Use the PPM utility to install MinGW and dmake from ActiveState's default repository for your Perl installation. Once you have those installed, you can then install modules from CPAN that need to be compiled. In your case, you should be able to open a command prompt and type cpan install DBD::JDBC to install the DBD::JDBC module.

    If you're using a 64-bit version of ActivePerl, that's a bit more complicated and I'm not sure I can really guide you through that process. If you are on a 64-bit Windows XP and really need 64-bit Perl, my personal recommendation would be to move to Strawberry Perl, which comes with a compiler and compiler tools.

    UPDATE: Corrected the module name. (s/DBD::ODBC/DBD::JDBC/g)

      Hi, I have installed Strawberry Perl on Win7 and still have not been able to install DBD::JDBC.

      Has anyone successfully installed this on Windows XP or Win7? I even tried installing 'make' for Windows and got some other weird errors when trying to install the module manually.

      Checking if your kit is complete... Looks good Using DBI 1.622 (for perl 5.016002 on MSWin32-x86-multi-thread) instal +led in C:/ strawberry/perl/vendor/lib/auto/DBI/ Writing Makefile for DBD::JDBC Writing MYMETA.yml and MYMETA.json cp JDBC.pod blib\lib\DBD\JDBC.pod cp JDBC.pm blib\lib\DBD\JDBC.pm cp lib/Bundle/DBD/JDBC.pm blib\lib\Bundle\DBD\JDBC.pm VIZDOM/DBD-JDBC-0.71.tar.gz C:\strawberry\c\bin\dmake.exe -- OK Running make test set CLASSPATH=dbd_jdbc.jar;t/hsqldb/hsqldb-1.8.0.2.jar;t/hsqldb/log4j- +1.2.13.jar ; C:\strawberry\perl\bin\perl.exe "-MExtUtils::Command::MM" "-e" "test_h +arness(0, 'blib\lib', 'blib\arch')" t/*.t t/01_env.t ...... ok t/02_connect.t .. 1/5 Exception in thread "main" java.lang.NoClassDefF +oundError: com.vizdom.dbd.jdbc.Server Caused by: java.lang.ClassNotFoundException: com.vizdom.dbd.jdbc.Serve +r at java.net.URLClassLoader.findClass(URLClassLoader.java:434) at java.lang.ClassLoader.loadClass(ClassLoader.java:660) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:35 +8) at java.lang.ClassLoader.loadClass(ClassLoader.java:626) Could not find the main class: com.vizdom.dbd.jdbc.Server. Program wi +ll exit. t/02_connect.t .. 3/5 # Failed test 'connected' # at t/02_connect.t line 40. # Connection error: Failed to open socket to server: IO::Socket::INET: + connect: No connection could be made because the target machine actively refuse +d it. # Looks like you failed 1 test of 5. t/02_connect.t .. Dubious, test returned 1 (wstat 256, 0x100) Failed 1/5 subtests (less 2 skipped subtests: 2 okay) t/03_hsqldb.t ... 1/22 Exception in thread "main" java.lang.NoClassDef +FoundError : com.vizdom.dbd.jdbc.Server Caused by: java.lang.ClassNotFoundException: com.vizdom.dbd.jdbc.Serve +r at java.net.URLClassLoader.findClass(URLClassLoader.java:434) at java.lang.ClassLoader.loadClass(ClassLoader.java:660) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:35 +8) at java.lang.ClassLoader.loadClass(ClassLoader.java:626) Could not find the main class: com.vizdom.dbd.jdbc.Server. Program wi +ll exit. t/03_hsqldb.t ... 2/22 # Failed test 'connected' # at t/03_hsqldb.t line 34. # Connection error: Failed to open socket to server: IO::Socket::INET: + connect: No connection could be made because the target machine actively refuse +d it. # Looks like you failed 1 test of 22. # Looks like your test exited with 1 just after 22. t/03_hsqldb.t ... Dubious, test returned 1 (wstat 256, 0x100) Failed 1/22 subtests (less 20 skipped subtests: 1 okay) t/basis.t ....... skipped: BASIS URL not defined t/oracle.t ...... skipped: Oracle URL not defined Test Summary Report ------------------- t/02_connect.t (Wstat: 256 Tests: 5 Failed: 1) Failed test: 3 Non-zero exit status: 1 t/03_hsqldb.t (Wstat: 256 Tests: 22 Failed: 1) Failed test: 2 Non-zero exit status: 1 Files=5, Tests=32, 9 wallclock secs ( 0.06 usr + 0.01 sys = 0.08 CP +U) Result: FAIL Failed 2/5 test programs. 2/32 subtests failed. dmake.exe: Error code 255, while making 'test_dynamic' VIZDOM/DBD-JDBC-0.71.tar.gz C:\strawberry\c\bin\dmake.exe test -- NOT OK //hint// to see the cpan-testers results for installing this module, t +ry: reports VIZDOM/DBD-JDBC-0.71.tar.gz Running make install make test had returned bad status, won't install without force Stopping: 'install' failed for 'DBD::JDBC'. Failed during this command: VIZDOM/DBD-JDBC-0.71.tar.gz : make_test NO
Re: Installing modules
by tobyink (Canon) on Jun 18, 2013 at 06:39 UTC

    What version of Perl are you using? Is it still supported by ActiveState? IIRC they require authentication for their PPM repositories once they've gone into extended (i.e. paid) support. (Perl 5.8/5.10/5.12 require authentication; possibly 5.14 too now that 5.18 has been released.)

    package Cow { use Moo; has name => (is => 'lazy', default => sub { 'Mooington' }) } say Cow->new->name
Re: Installing modules
by ww (Archbishop) on Jun 18, 2013 at 02:23 UTC
    Tangential: See CPAN testers reports. Many "fail"s are from win32 tests... suggesting that the module is not yet ready for prime-time on M$ boxen.

    If you didn't program your executable by toggling in binary, it wasn't really programming!

Re: Installing modules
by frozenwithjoy (Priest) on Jun 17, 2013 at 23:40 UTC
    I don't use windows, but on OS X or Linux, I'd write DBD::JDBC, not DBD-JDBC. Does Windows really require you to use a hyphen instead of double colons when installing modules?
      My understanding is that ActiveState's Active Perl 'ppm' installs CPAN modules that have been built/compiled by ActiveState. These compiled modules are stored in a special format in "repositories" which only work with Active Perl. This makes installing modules in Active Perl very easy. However not all CPAN modules are available.

      See:
      http://www.activestate.com/activeperl/ppm-perl-modules - some info about PPM & PPM Index
      http://code.activestate.com/ppm/ - PPM Index: lets you search to see if a specific CPAN module is available via ppm
      http://code.activestate.com/ppm/DBD-JDBC/ - indicates that "DBD-JDBC is unavailable in PPM, because there aren't any builds for it in the package repositories." ie all builds failed as indicated by the red icons.

      I don't see it in the list when running ppm, and "ppm install DBD-JDBC" doesn't find it.

      Explained by 3rd link above.

      I tried adding cpan to the repository list in ppm (http://www.cpan.org) but zero modules are added.

      Thats because CPAN does not provide a repository. CPAN provides modules in the form of source code for all platforms (but you have to build them), while repositories are provide a subset of CPAN's modules pre-built/compiled by ActiveState specifically for Active Perl.

      I'm afraid I don't know about the "authorization required" error.

      See this for some links that might be useful: Perl upgrade JComboBox alternative

      UPDATE: s/are/provide/
        (post moved down to end of comments. I clicked the wrong 'reply' link. Oops!)

      The PPM utility is trying install from .ppd files. In this case, the DBD::JDBC would have a file name of DBD-JDBC.ppd and the PPM utility would be referring to the module as DBD-JDBC (if I remember correctly). In Windows, you can't use the colon as part of a file or folder name.

Re: Installing modules
by aitap (Curate) on Jun 18, 2013 at 06:31 UTC

    Do you use some kind of proxy server? It might have disabled your access to any sites not listed in a whitelist (including CPAN mirrors and ActiveState PPD archive), thus HTTP 401 error.

    Once you have MinGW installed from ppm, you'll be able to compile the modules you install from cpan.

Re: Installing modules
by slugger415 (Monk) on Jun 18, 2013 at 16:54 UTC

    Wow thank you all for the useful responses! I feel a lot less confused now, understanding non-compiled modules and CPAN (thanks zork42), adding the compiler (thanks dasgar), and upgrading my Perl install to fix the authentication problem (thanks tobyink). And the rest of you, thanks.

    Using ActiveState for Win XP btw.

    So I've gotten a lot farther, was able to add the compiler and get past the authentication problem. Still seeing some problems I don't understand. Sorry for the long code post but here's a snippet of my output.

    C:\Perl\site\bin\dmake.exe -- OK Running make test set CLASSPATH=dbd_jdbc.jar;t/hsqldb/hsqldb-1.8.0.2.jar;t/hsqldb/log4j- +1.2.13.jar ; C:\Perl\bin\perl.exe "-MExtUtils::Command::MM" "-e" "test_harness(0, ' +blib\lib', 'blib\arch')" t/*.t t/01_env.t ...... ok t/02_connect.t .. 1/5 Error: Could not find or load main class com.viz +dom.dbd.jd bc.Server # Failed test 'connected' t/02_connect.t .. 3/5 # at t/02_connect.t line 40. # Connection error: Failed to open socket to server: IO::Socket::INET: + connect: No connection could be made because the target machine actively refuse +d it. # Looks like you failed 1 test of 5. t/02_connect.t .. Dubious, test returned 1 (wstat 256, 0x100) Failed 1/5 subtests (less 2 skipped subtests: 2 okay) t/03_hsqldb.t ... 1/22 Error: Could not find or load main class com.vi +zdom.dbd.j dbc.Server t/03_hsqldb.t ... 2/22 # Failed test 'connected' # at t/03_hsqldb.t line 34. # Connection error: Failed to open socket to server: IO::Socket::INET: + connect: No connection could be made because the target machine actively refuse +d it. # Looks like you failed 1 test of 22. # Looks like your test exited with 1 just after 22. t/03_hsqldb.t ... Dubious, test returned 1 (wstat 256, 0x100) Failed 1/22 subtests (less 20 skipped subtests: 1 okay) t/basis.t ....... skipped: BASIS URL not defined t/oracle.t ...... skipped: Oracle URL not defined Test Summary Report ------------------- t/02_connect.t (Wstat: 256 Tests: 5 Failed: 1) Failed test: 3 Non-zero exit status: 1 t/03_hsqldb.t (Wstat: 256 Tests: 22 Failed: 1) Failed test: 2 Non-zero exit status: 1 Files=5, Tests=32, 9 wallclock secs ( 0.03 usr + 0.11 sys = 0.14 CP +U) Result: FAIL Failed 2/5 test programs. 2/32 subtests failed. dmake.exe: Error code 255, while making 'test_dynamic' VIZDOM/DBD-JDBC-0.71.tar.gz C:\Perl\site\bin\dmake.exe test -- NOT OK //hint// to see the cpan-testers results for installing this module, t +ry: reports VIZDOM/DBD-JDBC-0.71.tar.gz Running make install make test had returned bad status, won't install without force

    I did try the "reports" but wasn't able to get it. I did see a page somewhere with a lot of bad news about the JDBC module, so maybe it's just not well defined for Windows.

    Should I use "force"? (how?)

    Scott

Re: Installing modules
by zork42 (Monk) on Jun 18, 2013 at 19:59 UTC
    I forgot to mention, I think ActiveState's Active Perl 'ppm' also handles module dependencies.

    I don't know how module dependencies are handled when installing from CPAN.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (5)
As of 2024-04-25 09:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found