0

I'm running Windows 8. I just downloaded ActivePerl and I'm running the code through Padre. I used PPM to install the required modules, but when I try to run the code I get the error "Can't locate Tk.pm". Did the modules get installed in the wrong location? How do I find the modules?

Edit: I'm not sure what the problem was and I probably will never know. I uninstalled perl, restarted my computer, installed it again and everything worked.

user3364161
  • 365
  • 5
  • 21
  • Could you have two installations of Perl? – ikegami Feb 19 '17 at 23:49
  • Did the module installation complete successfully? Did it complete the make? This is very vague, if you could post the output of the installation log, it would make it much easier for us to see what went wrong. –  Feb 20 '17 at 06:07
  • @Gerry, ppm pretty much just unzips a pre-compiled package. If the package exists, failure is not really possible. – ikegami Feb 20 '17 at 06:35
  • @ikegami, correct yes, but I have seen on windows that it sometimes fails when doing the make, hence the question. –  Feb 20 '17 at 07:02
  • @Gerry, `ppm` doesn't use `make`. Again, `ppm` pretty much just unzips a pre-compiled package. If the package exists, failure is not really possible. I have therefore answered your question (twice). – ikegami Feb 20 '17 at 07:43
  • Re "*How do I find the modules?*", `ppm` installs them somewhere the `perl` executing `ppm` looks for them. That's why I'm asking if there could be two instances of `perl` on your machine (one that ran `ppm`, and one run from Padre). – ikegami Feb 20 '17 at 07:46

3 Answers3

0

Did the modules get installed in the wrong location?

No, to the best of my knowledge, ppm is incapable of doing that.

Three possibilities come to mind.

  • You installed the module using one perl, but you are using a different one when using Padre. (Solution: Install the module using the correct Perl, meaning by using the ppm or cpan in that Perl's bin dir.)

  • There's some kind of permission issue preventing the module from being found. (Not very likely if you installed the module using the same user as the one trying to use it.)

  • The installation failed. (What error did you get?)


If you need further help, could you please provide the ouptut of dir /s/b c:\Tk.pm and the output of perl -le"print $^X"?

ikegami
  • 367,544
  • 15
  • 269
  • 518
-1

You can try manually looking in the Perl lib folders usually they will be present inside the target directory where you installed ActivePerl. Like C:\Perl\lib and C:\Perl\site\lib. Try searching for the module in these locations.

You can also use this command from cmd - perl -e "use Tk". You can also refer to the following link for more options on checking whether a module is installed or not in your system.

Community
  • 1
  • 1
Mohit
  • 608
  • 4
  • 19
  • Then what? Where are you going with this? – ikegami Feb 20 '17 at 19:19
  • Find whether module is installed or not. Which is what should be done in case of the above query. – Mohit Feb 21 '17 at 07:28
  • Then what? Where are you going with this? – ikegami Feb 21 '17 at 19:18
  • Then you come to know whether it is successfully installed or not. For your information the question was - Did the modules get installed in the wrong location? How do I find the modules? – Mohit Feb 22 '17 at 05:19
  • Re "*Then you come to know whether it is successfully installed or not.*", So you think they were mistaken when they said they installed the module using `ppm`? I find that hard to believe. – ikegami Feb 22 '17 at 05:29
  • Re "*For your information the question was - Did the modules get installed in the wrong location? How do I find the modules?*", I think you are gravely mistaken. It's silly to think they don't want their problem solved. – ikegami Feb 22 '17 at 05:30
  • But for an appropriate answer we would have needed this information. – Mohit Feb 22 '17 at 05:33
-1

Below is a way to check if the installation is OK, and just a workaround, think again before use it in production.

First, check if Tk.pm exists in your hard disk. One way is by installing Everything and search for the file. If the file exists, and in a directory such as "C:/some_path/TK.pm"

Then in the script, specify the path by use lib 'C:/some_path', this will add 'C:/some_path' to perl module search path. Then use Tk should be OK.

 use lib 'C:/some_path';
 use Tk;
 print join ", ", @INC; # see the search path
astropeak
  • 147
  • 1
  • 8
  • The only thing this could possibly accomplish is to have one `perl` use a module installed by another `perl`, and that's bad. Remember, the module was installed by `ppm`, not `cpan`/`cpanm`, so (the the best of my knowledge) it couldn't have been installed in an "incorrect" location. – ikegami Feb 20 '17 at 19:14