cannot find module in @INC

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • zcabeli
    New Member
    • Jan 2008
    • 51

    cannot find module in @INC

    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 ,
  • numberwhun
    Recognized Expert Moderator Specialist
    • May 2007
    • 3467

    #2
    Originally posted by zcabeli
    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

    Comment

    • zcabeli
      New Member
      • Jan 2008
      • 51

      #3
      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 ...

      Comment

      • numberwhun
        Recognized Expert Moderator Specialist
        • May 2007
        • 3467

        #4
        Originally posted by zcabeli
        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

        Comment

        • zcabeli
          New Member
          • Jan 2008
          • 51

          #5
          hello again Jeff,

          i think i learnt how to use the CPAN interface, but it always fails in installing new packages.

          for example, i tried to install Bundle::CPAN and that's the log notes i got...
          it's strange since the file Bundle-CPAN-1.857.tar.gz exist, as opposed to what's written in the log message... do you have any idea what might lead to this fault ?

          cpan> install Bundle::CPAN
          CPAN: Storable loaded ok
          Going to read yes/Metadata
          Database was generated on Sun, 16 Mar 2008 12:30:47 GMT

          CPAN: MD5 security checks disabled because MD5 not installed.
          Please consider installing the MD5 module.

          gzip: yes/sources/authors/id/A/AN/ANDK/Bundle-CPAN-1.857.tar.gz: No such file or directory
          gzip: yes/sources/authors/id/A/AN/ANDK/Bundle-CPAN-1.857.tar.gz: No such file or directory
          /bin/tar: yes/sources/authors/id/A/AN/ANDK/Bundle-CPAN-1.857.tar.gz: Cannot open: No such file or directory
          /bin/tar: Error is not recoverable: exiting now
          Using Tar:/bin/tar xvf yes/sources/authors/id/A/AN/ANDK/Bundle-CPAN-1.857.tar.gz:
          /bin/tar: yes/sources/authors/id/A/AN/ANDK/Bundle-CPAN-1.857.tar.gz: Cannot open: No such file or directory
          /bin/tar: Error is not recoverable: exiting now
          Couldn't untar yes/sources/authors/id/A/AN/ANDK/Bundle-CPAN-1.857.tar.gz


          thanks alot,

          Comment

          • numberwhun
            Recognized Expert Moderator Specialist
            • May 2007
            • 3467

            #6
            Originally posted by zcabeli
            hello again Jeff,

            i think i learnt how to use the CPAN interface, but it always fails in installing new packages.

            for example, i tried to install Bundle::CPAN and that's the log notes i got...
            it's strange since the file Bundle-CPAN-1.857.tar.gz exist, as opposed to what's written in the log message... do you have any idea what might lead to this fault ?

            cpan> install Bundle::CPAN
            CPAN: Storable loaded ok
            Going to read yes/Metadata
            Database was generated on Sun, 16 Mar 2008 12:30:47 GMT

            CPAN: MD5 security checks disabled because MD5 not installed.
            Please consider installing the MD5 module.

            gzip: yes/sources/authors/id/A/AN/ANDK/Bundle-CPAN-1.857.tar.gz: No such file or directory
            gzip: yes/sources/authors/id/A/AN/ANDK/Bundle-CPAN-1.857.tar.gz: No such file or directory
            /bin/tar: yes/sources/authors/id/A/AN/ANDK/Bundle-CPAN-1.857.tar.gz: Cannot open: No such file or directory
            /bin/tar: Error is not recoverable: exiting now
            Using Tar:/bin/tar xvf yes/sources/authors/id/A/AN/ANDK/Bundle-CPAN-1.857.tar.gz:
            /bin/tar: yes/sources/authors/id/A/AN/ANDK/Bundle-CPAN-1.857.tar.gz: Cannot open: No such file or directory
            /bin/tar: Error is not recoverable: exiting now
            Couldn't untar yes/sources/authors/id/A/AN/ANDK/Bundle-CPAN-1.857.tar.gz


            thanks alot,
            Bundle CPAN aside, have you tried to install the module that you originally started this thread about?

            Regards,

            Jeff

            Comment

            • zcabeli
              New Member
              • Jan 2008
              • 51

              #7
              yep, and it gave me almost exactly the same result, although the file libwin32-0.28.tar.gz exists in the specified path:



              cpan> install Win32::OLE
              CPAN: Storable loaded ok
              Going to read yes/Metadata
              Database was generated on Sun, 16 Mar 2008 12:30:47 GMT
              Running install for module Win32::OLE
              Running make for J/JD/JDB/libwin32-0.28.tar.gz

              CPAN: MD5 security checks disabled because MD5 not installed.
              Please consider installing the MD5 module.

              gzip: yes/sources/authors/id/J/JD/JDB/libwin32-0.28.tar.gz: No such file or directory
              gzip: yes/sources/authors/id/J/JD/JDB/libwin32-0.28.tar.gz: No such file or directory
              /bin/tar: yes/sources/authors/id/J/JD/JDB/libwin32-0.28.tar.gz: Cannot open: No such file or directory
              /bin/tar: Error is not recoverable: exiting now
              Using Tar:/bin/tar xvf yes/sources/authors/id/J/JD/JDB/libwin32-0.28.tar.gz:
              /bin/tar: yes/sources/authors/id/J/JD/JDB/libwin32-0.28.tar.gz: Cannot open: No such file or directory
              /bin/tar: Error is not recoverable: exiting now
              Couldn't untar yes/sources/authors/id/J/JD/JDB/libwin32-0.28.tar.gz

              Comment

              • numberwhun
                Recognized Expert Moderator Specialist
                • May 2007
                • 3467

                #8
                Originally posted by zcabeli
                yep, and it gave me almost exactly the same result, although the file libwin32-0.28.tar.gz exists in the specified path:



                cpan> install Win32::OLE
                CPAN: Storable loaded ok
                Going to read yes/Metadata
                Database was generated on Sun, 16 Mar 2008 12:30:47 GMT
                Running install for module Win32::OLE
                Running make for J/JD/JDB/libwin32-0.28.tar.gz

                CPAN: MD5 security checks disabled because MD5 not installed.
                Please consider installing the MD5 module.

                gzip: yes/sources/authors/id/J/JD/JDB/libwin32-0.28.tar.gz: No such file or directory
                gzip: yes/sources/authors/id/J/JD/JDB/libwin32-0.28.tar.gz: No such file or directory
                /bin/tar: yes/sources/authors/id/J/JD/JDB/libwin32-0.28.tar.gz: Cannot open: No such file or directory
                /bin/tar: Error is not recoverable: exiting now
                Using Tar:/bin/tar xvf yes/sources/authors/id/J/JD/JDB/libwin32-0.28.tar.gz:
                /bin/tar: yes/sources/authors/id/J/JD/JDB/libwin32-0.28.tar.gz: Cannot open: No such file or directory
                /bin/tar: Error is not recoverable: exiting now
                Couldn't untar yes/sources/authors/id/J/JD/JDB/libwin32-0.28.tar.gz
                Since you are on Unix, I will ask this. Are you trying to run this as yourself, or as a root permissioned user? The best way to run the CPAN interface is with 'sudo'. That is because you will find that root is needed for the installation and sudo permission is definitely needed.

                So, I would try running all of this under sudo and see if it works.

                Regards,

                Jeff

                Comment

                • zcabeli
                  New Member
                  • Jan 2008
                  • 51

                  #9
                  hey Jeff,

                  the thing is that i don't have root permissions.
                  i just want to install those packages in my local directory.
                  i tried to run CPAN I/F with 'sudo' but it requested password, which i don't have.

                  the question is whether i can install packages without being 'root' using CPAN.


                  thanks again,
                  zohar

                  Comment

                  • KevinADC
                    Recognized Expert Specialist
                    • Jan 2007
                    • 4092

                    #10
                    You're loading Win32::OLE onto a Unix box? How do you expect to use it on Unix?

                    Comment

                    • numberwhun
                      Recognized Expert Moderator Specialist
                      • May 2007
                      • 3467

                      #11
                      Originally posted by zcabeli
                      hey Jeff,

                      the thing is that i don't have root permissions.
                      i just want to install those packages in my local directory.
                      i tried to run CPAN I/F with 'sudo' but it requested password, which i don't have.

                      the question is whether i can install packages without being 'root' using CPAN.


                      thanks again,
                      zohar
                      First, to address my complete oversight that is so kindly pointed out by Kevin, Win32::OLE on a Unix box? I hope you have plans of running this on a Windows machine eventually and not Unix.

                      Second, most people won't have root to their machine in a work environment, but you may have or be able to get sudo setup by your administrator. If not, how do you plan on installing the modules? The only thing you would be able to do is to get your administrator to do it for you.

                      Regards,

                      Jeff

                      Comment

                      Working...