Forum Moderators: coopster & phranque

Message Too Old, No Replies

Confusing Error Message

         

rainborick

6:24 pm on Jun 22, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I have a script that I was planning to enhance with Image Magick and ran into an odd problem. The script dies with the error message:

Can't locate Image/Magick.pm in @INC ...

when all I've done is add

use Image::Magick;

Without it, the script runs to completion. PerlDiver says Image::Magick is there. The error message's reference to "Image\Magick" catches my eye, but that might just be normal. The hosting service's initial response was boilerplate and didn't address the issue. Any suggestions for a workaround or fix would be appreciated.

bsterz

2:44 am on Jun 24, 2006 (gmt 0)

10+ Year Member



What's the rest of that message say? What IS in @inc?

rainborick

2:59 am on Jun 24, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



The complete error message is:

Can't locate Image/Magick.pm in @INC (@INC contains: /usr/local/lib/perl5/5.8.3/i386-freebsd /usr/local/lib/perl5/5.8.3 /usr/local/lib/perl5/site_perl/5.8.3/i386-freebsd /usr/local/lib/perl5/site_perl/5.8.3 /usr/local/lib/perl5/site_perl .) at addProduct.cgi line 19.
BEGIN failed--compilation aborted at addProduct.cgi line 19.

perl_diver

4:57 am on Jun 24, 2006 (gmt 0)

10+ Year Member



the forward slash is normal in the error message. The :: in Modules is converted to a slash because it's really a directory path. But I don't know why your script isn't finding the module if it is in fact installed.

rocknbil

5:37 pm on Jun 24, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



@INC is the collection of paths that perl looks in when it executes a program. Where is ImageMagick actually installed? You can bet it's not in one of those paths in @INC. :-)

The solution is to push the correct path onto @INC for your program or alter the perl config to include that path on startup. You can also use the deprecated include ('path/to/Image/Magick.pm');

The other possibility is the correct permissions are not set on the directory and your program can't access it? (long shot)

Sorry if this seems academic and you've already tried it but I have been here many times and it's always this, or something a lot like it. :-D

rainborick

6:25 pm on Jun 24, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Thanks, guys. I was pretty certain that it was a lack of ImageMagick itself not being installed, but I couldn't believe a host would install the CPAN module without ImageMagick itself being available. I'm off now to see if this hosting service has taken any action.

perl_diver

10:20 pm on Jun 24, 2006 (gmt 0)

10+ Year Member




PerlDiver says Image::Magick is there.

PerlDiver looks in @INC to see which modules are installed. Why PerlDiver reports the module as installed but your script can't find it, I don't know.

bsterz

10:40 pm on Jun 25, 2006 (gmt 0)

10+ Year Member



If you have a shell account you could try:

# which convert

It would tell you if and where IM is installed

texmex

7:23 pm on Jul 2, 2006 (gmt 0)

10+ Year Member



Did you know that ImageMagick has it's own forum? After spending hours trying to get PerlMagick (the perl interface to ImageMagick) installed on my server, I posted on their forum and had the problem licked in no time.

Try [redux.imagemagick.org...]

They deal purely with ImageMagic and it's various APIs. I believe, some of the members are the actual developers of ImageMagic.

rainborick

3:15 pm on Jul 3, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Yes, I'm a frequent visitor to the IM website. Its certainly the place to go with technical issues that deal directly with their software. My problem was with a hosting service where the software 'magically' appeared on the server after about 4 pointed, but polite, Emails to the tech support dept. (who still claim the package was there all along). So, thanks to everyone for the help. I'm good now.