51Testing软件测试论坛

标题: install_driver(Pg) failed: Can't locate DBD/Pg.pm in @INC [打印本页]

作者: 樱花季节    时间: 2011-4-11 14:08
标题: install_driver(Pg) failed: Can't locate DBD/Pg.pm in @INC
在运行perl脚本的时候,如果遇到如下问题:

install_driver(Pg) failed: Can't locate DBD/Pg.pm in @INC (@INC contains: /usr/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi /usr/lib64/perl5/site_perl/5.8.7/x86_64-linux-thread-multi /usr/lib64/perl5/site_perl/5.8.6/x86_64-linux-thread-multi /usr/lib64/perl5/site_perl/5.8.5/x86_64-linux-thread-multi /usr/lib/perl5/site_perl/5.8.8 /usr/lib/perl5/site_perl/5.8.7 /usr/lib/perl5/site_perl/5.8.6 /usr/lib/perl5/site_perl/5.8.5 /usr/lib/perl5/site_perl /usr/lib64/perl5/vendor_perl/5.8.8/x86_64-linux-thread-multi /usr/lib64/perl5/vendor_perl/5.8.7/x86_64-linux-thread-multi /usr/lib64/perl5/vendor_perl/5.8.6/x86_64-linux-thread-multi /usr/lib64/perl5/vendor_perl/5.8.5/x86_64-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.8 /usr/lib/perl5/vendor_perl/5.8.7 /usr/lib/perl5/vendor_perl/5.8.6 /usr/lib/perl5/vendor_perl/5.8.5 /usr/lib/perl5/vendor_perl /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/5.8.8 .) at (eval 1) line 3.

说明你没有安装DBD,DBI模块,此时perl是不能与数据库进行交互的,解放方法如下:

为了让perl能够与oracle数据库进行交互,需要安装DBI模块和DBD::Oracle模块,安装顺序是先安装DBI,再安装DBD::Oracle。步骤:1. 下载并解压DBI模块和DBD::Oracle模块下载命令是:wget  http:// shahaizimxm/soft/DBI.tar  -P  /home/qaadmin ( http:// shahaizimxm/soft/DBI.tar  是下载的url地址)wget  http://shahaizmxm/soft/DBD_Oracle.tar  -P  /home/qaadmin (http://shahaizmxm/soft/DBD_Oracle.tar  是下载的url地址)2.  解压解压命令是:tar  xvf  /home/qaadmin/DBI.tar tar  xvf  /home/qaadmin/DBD_Oracle.tar 3. 安装在目录/home/shahaizimxm/DBD_Oracle和/home/shahaizimxm/DBI下分别对两个模块执行下面命令:  perl  Makefile.PL  make  make  install其中make  install步骤需要root权限。

在perl中需要操作excel的时候,如果没有安装相应的模块,会报错:Can't locate Spreadsheet/WriteExcel.pm in @INC,解决方法是按照上述方法下载excel模块然后进行安装excle。


本文来自CSDN博客,转载请标明出处:http://blog.csdn.net/shahaizimxm/archive/2011/04/11/6315390.aspx




欢迎光临 51Testing软件测试论坛 (http://bbs.51testing.com/) Powered by Discuz! X3.2