在@INC中找不到模块 [英] cannot find module in @INC

查看:101
本文介绍了在@INC中找不到模块的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,


我有一个使用WIN32 :: OLE的脚本,我从CPAN下载并通过解压缩安装...我还添加到了在BEGIN阶段编写包含行到@INC的脚本。


BEGIN {

推@INC," /work/perl/libwin32-0.28/OLE/lib/" ;;

}


然而,它找不到.pm,即使这个文件确实存在于这个文件夹中...



"

无法在@INC中找到模块Win32 :: OLE的可加载对象(@INC包含:/mswg/opt/lib/perl5/5.6.0/i686-linux / mswg /opt/lib/perl5/5.6.0 /mswg/opt/lib/perl5/site_perl/5.6.0/i686-linux /mswg/opt/lib/perl5/site_perl/5.6.0 / mswg / opt / lib / perl5 / site_perl./work/perl/libwin32-0.28/OLE/lib/ /work/perl/XML-Parser-2.36)在excel.pl第9行

"

你有没有猜测为什么它没有这样做?



谢谢,

解决方案


你好,


我有一个脚本使用从CPAN下载的WIN32 :: OLE通过解压缩安装...我还在脚本中添加了包含线在BEGIN阶段到@INC。


BEGIN {

推@INC," /work/perl/libwin32-0.28/OLE/lib/" ;;

}


然而,它找不到.pm,即使这个文件确实存在于这个文件夹中...



"

无法在@INC中找到模块Win32 :: OLE的可加载对象(@INC包含:/mswg/opt/lib/perl5/5.6.0/i686-linux / mswg /opt/lib/perl5/5.6.0 /mswg/opt/lib/perl5/site_perl/5.6.0/i686-linux /mswg/opt/lib/perl5/site_perl/5.6.0 / mswg / opt / lib / perl5 / site_perl./work/perl/libwin32-0.28/OLE/lib/ /work/perl/XML-Parser-2.36)在excel.pl第9行

"

你有没有猜测为什么它没有这样做?



谢谢,



看起来你正在使用* nix系统。为什么要下载并手动安装模块而不是使用CPAN接口,这样可以为您完成所有操作?


无论哪种方式,如果你选择手动进行模块安装的艰难路线,那么你需要真正阅读文档,然后继续。


安装模块通常有4个步骤:


DECOMPRESS文件

UNPACK将文件放入目录

构建模块(有时不必要)

安装模块。



你做了第一个就是它。我会认真考虑阅读该文件,因为它会启发你。此外,如果你可以使用CPAN接口,那么你也应该这样做,因为它也可以执行自动检查依赖关系和安装那些相关模块。


问候,


Jeff


感谢帮助伙伴们,我真的从这篇文章中学到了一些东西...

i试图按照那里的内容工作,但我面临编译错误。


MakeFile的生成几乎顺利(除了一个找不到的扩展名)


然而,''make''它无法找到许多文件,如命令输出中所示:


make [1]:进入目录`/home/zcabeli/work/perl/libwin32-0.28 / APINet''

gcc -c -fno-strict-aliasing -I / usr / local / include -O2 -march = i386 -mcpu = i686 -DVERSION = \" 0.10 \" ; -DXS_VERSION = \" 0.10\" -fPIC -I / usr / lib / perl5 / 5.6.1 / i386-linux / CORE Net.c

Net.xs:1:21:windows.h:没有这样的文件或目录

Net.xs:3:24:winsock.h:没有这样的文件或目录

Net.xs:5:60:lmcons.h:没有这样的文件或目录

Net.xs:6:66:lmerr.h:没有这样的文件或目录

Net.xs:7:22:lmUseFlg.h:没有这样的文件或目录

Net.xs:8:22:lmAccess.h:没有这样的文件或目录

Net.xs:9:22:lmAPIBuf.h:没有这样的文件或目录

Net.xs:10:21:lmwksta.h:没有这样的文件或目录

Net.xs:13:22:lmServer.h:没有这样的文件或目录

make [1]:*** [Net.o]错误1

make [1]:离开目录`/home/zcabeli/work/perl/libwin32-0.28/ APINet''

make:*** [subdirs]错误2


我不知道这些文件意味着什么,但我相信它可能连接到Windows而不是unix(我的操作系统),也许我应该下载此软件包的另一个版本...



感谢帮助伙伴,我真的从这篇文章中学到了一些东西...

i试图按照那里的内容工作,但我面临编译错误。


MakeFile的生成几乎顺利(除了一个找不到的扩展名)


然而,''make''它无法找到许多文件,如命令输出中所示:


make [1]:进入目录`/home/zcabeli/work/perl/libwin32-0.28 / APINet''

gcc -c -fno-strict-aliasing -I / usr / local / include -O2 -march = i386 -mcpu = i686 -DVERSION = \" 0.10 \" ; -DXS_VERSION = \" 0.10\" -fPIC -I / usr / lib / perl5 / 5.6.1 / i386-linux / CORE Net.c

Net.xs:1:21:windows.h:没有这样的文件或目录

Net.xs:3:24:winsock.h:没有这样的文件或目录

Net.xs:5:60:lmcons.h:没有这样的文件或目录

Net.xs:6:66:lmerr.h:没有这样的文件或目录

Net.xs:7:22:lmUseFlg.h:没有这样的文件或目录

Net.xs:8:22:lmAccess.h:没有这样的文件或目录

Net.xs:9:22:lmAPIBuf.h:没有这样的文件或目录

Net.xs:10:21:lmwksta.h:没有这样的文件或目录

Net.xs:13:22:lmServer.h:没有这样的文件或目录

make [1]:*** [Net.o]错误1

make [1]:离开目录`/home/zcabeli/work/perl/libwin32-0.28/ APINet''

make:*** [subdirs]错误2


我不知道这些文件意味着什么,但我相信它可能连接到Windows而不是unix(我的操作系统),也许我应该下载此软件包的另一个版本...



A我已经提到过,你会发现有很多模块都有依赖关系。这些依赖项通常是在软件完全安装之前必须安装的其他模块。


是否有任何理由不能使用CPAN接口而不是手动构建?在设置CPAN界面期间,您可以将其设置为关注,这意味着它将自动下载并安装任何依赖项。这样,当你完成一个模块的安装时,它完成后就可以正常工作了。


问候,


杰夫

Hello,

i''ve a script that uses WIN32::OLE which i downloaded from CPAN and installed it by unzipping... i''ve also added to the script the inclusion lines to @INC in BEGIN phase.

BEGIN{
push @INC, "/work/perl/libwin32-0.28/OLE/lib/";
}

however, it cannot find the .pm even though this file actually exists in this folder ...


"
Can''t locate loadable object for module Win32::OLE in @INC (@INC contains: /mswg/opt/lib/perl5/5.6.0/i686-linux /mswg/opt/lib/perl5/5.6.0 /mswg/opt/lib/perl5/site_perl/5.6.0/i686-linux /mswg/opt/lib/perl5/site_perl/5.6.0 /mswg/opt/lib/perl5/site_perl . /work/perl/libwin32-0.28/OLE/lib/ /work/perl/XML-Parser-2.36) at excel.pl line 9
"

do you have any guesses why it fails to do so?



thanks ,

解决方案

Hello,

i''ve a script that uses WIN32::OLE which i downloaded from CPAN and installed it by unzipping... i''ve also added to the script the inclusion lines to @INC in BEGIN phase.

BEGIN{
push @INC, "/work/perl/libwin32-0.28/OLE/lib/";
}

however, it cannot find the .pm even though this file actually exists in this folder ...


"
Can''t locate loadable object for module Win32::OLE in @INC (@INC contains: /mswg/opt/lib/perl5/5.6.0/i686-linux /mswg/opt/lib/perl5/5.6.0 /mswg/opt/lib/perl5/site_perl/5.6.0/i686-linux /mswg/opt/lib/perl5/site_perl/5.6.0 /mswg/opt/lib/perl5/site_perl . /work/perl/libwin32-0.28/OLE/lib/ /work/perl/XML-Parser-2.36) at excel.pl line 9
"

do you have any guesses why it fails to do so?



thanks ,

It looks like you are using a *nix system. Why are you downloading and manually installing modules instead of using the CPAN interface, which does it all for you?

Either way, if you are choosing to go the hard route of doing the module installation manually, then you will need to really read the documentation before continuing.

There are typically 4 steps to the installation of modules:

DECOMPRESS the file
UNPACK the file into a directory
BUILD the module (sometimes unnecessary)
INSTALL the module.


You did the first one and that was it. I would seriously consider reading the document as it will enlighten you. Also, if you can use the CPAN interface, it would behoove you as it can also perform automatic checking of dependencies and installation of those dependent modules.

Regards,

Jeff


thanks for the help buddy, i really learnt something from this article...
i tried to work according to what inscribed there, but i face a compilation error.

the generation of the MakeFile goes almost smoothly (besides one extension which it cannot find)

however, on the ''make'' it''s unable to locate many files as it be seen in the command output:

make[1]: Entering directory `/home/zcabeli/work/perl/libwin32-0.28/APINet''
gcc -c -fno-strict-aliasing -I/usr/local/include -O2 -march=i386 -mcpu=i686 -DVERSION=\"0.10\" -DXS_VERSION=\"0.10\" -fPIC -I/usr/lib/perl5/5.6.1/i386-linux/CORE Net.c
Net.xs:1:21: windows.h: No such file or directory
Net.xs:3:24: winsock.h: No such file or directory
Net.xs:5:60: lmcons.h: No such file or directory
Net.xs:6:66: lmerr.h: No such file or directory
Net.xs:7:22: lmUseFlg.h: No such file or directory
Net.xs:8:22: lmAccess.h: No such file or directory
Net.xs:9:22: lmAPIBuf.h: No such file or directory
Net.xs:10:21: lmwksta.h: No such file or directory
Net.xs:13:22: lmServer.h: No such file or directory
make[1]: *** [Net.o] Error 1
make[1]: Leaving directory `/home/zcabeli/work/perl/libwin32-0.28/APINet''
make: *** [subdirs] Error 2

i''m not sure what these files mean to do, but i believe it might be connected to windows and not unix (my OS), perhaps i should download another version of this package ...


thanks for the help buddy, i really learnt something from this article...
i tried to work according to what inscribed there, but i face a compilation error.

the generation of the MakeFile goes almost smoothly (besides one extension which it cannot find)

however, on the ''make'' it''s unable to locate many files as it be seen in the command output:

make[1]: Entering directory `/home/zcabeli/work/perl/libwin32-0.28/APINet''
gcc -c -fno-strict-aliasing -I/usr/local/include -O2 -march=i386 -mcpu=i686 -DVERSION=\"0.10\" -DXS_VERSION=\"0.10\" -fPIC -I/usr/lib/perl5/5.6.1/i386-linux/CORE Net.c
Net.xs:1:21: windows.h: No such file or directory
Net.xs:3:24: winsock.h: No such file or directory
Net.xs:5:60: lmcons.h: No such file or directory
Net.xs:6:66: lmerr.h: No such file or directory
Net.xs:7:22: lmUseFlg.h: No such file or directory
Net.xs:8:22: lmAccess.h: No such file or directory
Net.xs:9:22: lmAPIBuf.h: No such file or directory
Net.xs:10:21: lmwksta.h: No such file or directory
Net.xs:13:22: lmServer.h: No such file or directory
make[1]: *** [Net.o] Error 1
make[1]: Leaving directory `/home/zcabeli/work/perl/libwin32-0.28/APINet''
make: *** [subdirs] Error 2

i''m not sure what these files mean to do, but i believe it might be connected to windows and not unix (my OS), perhaps i should download another version of this package ...

As I had mentioned, you will find that there are many modules that have dependencies. Those dependencies are usually other modules that have to already be installed before the software will fully install.

Is there any reason that you cannot use the CPAN interface instead of manual build? During the setup of the CPAN interface, you can set it up to "follow", which means it will automatically download and install any dependencies. That way, when you do an installation of a module, when it is done, it should just work.

Regards,

Jeff


这篇关于在@INC中找不到模块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆