Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Can't locate DBI.pm in @INC

by krishjack (Initiate)
on Dec 10, 2001 at 20:40 UTC ( #130699=perlquestion: print w/ replies, xml ) Need Help??
krishjack has asked for the wisdom of the Perl Monks concerning the following question:

Hai i am just new to perl. I installed activestate. I am trying to run one example from a book. The example uses DBI for getting the available drivers and connecting to a database. When i run the *.pl file from the browser, i am getting the error as:

Can't locate DBI.PM in @INC (@INC contains: C:/Perl/lib C:/Perl/site/lib .) at c:/apache/cgi-bin/sql_get.pl.

So after that i tried to install DBI.PM using PPM. It's then saying that it could'nt find the path for the PPD. can anyone guide me in this aspect.

I am using apache as my webserver to run my *.pl

Thx in advance.
jagan

Comment on Can't locate DBI.pm in @INC
Download Code
Re: Can't locate DBI.pm in @INC
by Ovid (Cardinal) on Dec 10, 2001 at 21:46 UTC

    If you have just installed ActiveState, you don't have DBI as this is not a standard module. Use ppm. At the command line, type 'ppm'. When the prompt comes up, type 'install DBI' and follow the prompts.

Re: Can't locate DBI.pm in @INC
by Anonymous Monk on Apr 16, 2004 at 08:51 UTC
    If you don't have active perl (and hence don't have ppm), you can also get DBI like this:

    perl -MCPAN -e 'install DBI'

    That fixed it for me. And then you might need to install drivers like this (for Postgres):

    perl -MCPAN -e 'install DBD::Pg'

    Hope that helps.

Re: Can't locate DBI.pm in @INC
by Anonymous Monk on Jun 18, 2004 at 03:16 UTC
    i have this problem..: CGI Error The specified CGI application misbehaved by not returning a complete set of HTTP headers. The headers it did return are: Can't locate http://www.etude.com.mx/cgi-bin/cgi-lib.pl in @INC (@INC contains: C:/Perl/lib C:/Perl/site/lib .) at \\172.21.6.14\s002\etude.com.mx\CGI-BIN\envia.pl line 6. mi mail is: tizac2001@etude.com.mx I dont find the answer of this error
Can't locate DBI.pm in @INC
by Avitar (Acolyte) on Nov 24, 2004 at 19:15 UTC
    Perl is installed, but the eggheads in their infinate wisdom forgot to add the path variable for the lib's you need for your os.

    I was able to work around this by adding "C:\Perl\lib;C:\Perl\site\lib" to the 'PATH' and/or 'PERL5LIB' environment variable.

    In windows 2000/2003/xp it cen be found near: right click my computer->properties->avanced tab Environmental Var

    David Smith
    Avitar.Net
Re: Can't locate DBI.pm in @INC
by Khen1950fx (Canon) on Jul 21, 2006 at 23:17 UTC
    Granted---this an old question, but I thought I would revisit it to see if I could help my friends. When I first started in Perl, I got the "Can't locate" warning a lot. In fact, most of the time. Then I discovered what it was that I was doing wrong. OK...I was a newbie...In my case, the answer was simple. I created a folder on my Desktop and named it, say Algorithm::Diff. Then I would put the tarball in it and extract it there. Then I would run perl Makefile.PL, then make---oops! "Can't locate" would pop up and up. Hmmm...I admit that it took me a long time to figure out this one---Perl accepts a double colon, but my system was looking for a single dash. The Algorithm::Diff folder on my Desktop was the problem. I renamed it to Algorithm-Diff, and then it worked. I learned my lesson---keep it simple. A simple mistake is usually the most deadly...

    If the path's ok, then the next thing I look at is dependencies. The output will usually tell you what module is missing. Sometimes the program will ask you if you want the module installed. Sometimes not. If not, then install it manually. Then I use pmvers from pmtools to make sure that the dependency is actually there. If it isn't, then pmvers will come back at you with it's own "Can't locate...". Check all the dependencies and the module that you're installing.

    Based on my own experience, the procedures above have solved my "Can't locate" problem 90% of the time. The remaining 10%---that's another question.

      there may be multiple perl binaries installed on your machine check your PATH which one are you accessing. I went thru this frustration once.
      Hi, On my case, my program works simetimes fine but simetimes i got the error "can't locate", all dependecies are installed. it's hard to find the source of this problem.
Re: Can't locate DBI.pm in @INC
by Anonymous Monk on Mar 06, 2010 at 22:01 UTC
    bash-2.05$ ./abc.pl Can't locate DBI.pm in @INC (@INC contains: /usr/perl5/5.6.1/lib/sun4-solaris-64int /usr/perl5/5.6.1/lib /usr/perl5/site_perl/5.6.1/sun4-solaris-64int /usr/perl5/site_perl/5.6.1 /usr/perl5/site_perl /usr/perl5/vendor_perl/5.6.1/sun4-solaris-64int /usr/perl5/vendor_perl/5.6.1 /usr/perl5/vendor_perl .) at ./abc.pl line 4. BEGIN failed--compilation aborted at ./abc.pl line 4.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (10)
As of 2014-12-28 06:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (178 votes), past polls