[Tutor] unable to import Image module from my application

Emile van Sebille emile at fenx.com
Wed Oct 1 15:10:26 CEST 2008


ShivKumar Anand wrote:
> I am using Python Image library on windows and it is running well.
>  
> I am using RHEL E4 on another machine and when I installed 
> "python-imaging-1.1.6-2.el4.rf.i386.rpm", still i am not able to call 
> the Image and ImagOps modules from my application on this Linux machine.
>  
> After that --I manually added Imaging1.1.4 folder in 
> /usr/lib/Python2.4/site-packages and added entry in easy_install.pth.
> After that, I am able to import the modules from python prompt, but 
> still I am not able to import from my application.

It's likely you've still got a path issue.  When you import from the 
command line the contents of your current directory is importable.  I'd 
suspect you were in the PIL directory when you tested from the command line.

To verify a path problem, add
sys.path.append('/usr/lib/Python2.4/site-packages//usr/lib/Python2.4/site-packages')
prior to the import in your application.  If that works, double check 
your path setup.

HTH,

Emile


>  
> I am not able to figure out the exact reason for this.
>  
>  
> Kindly guiide me.
> Thanks in anticipation.
>  
>  
> Shiv
> 
> ------------------------------------------------------------------------
> MSN Technology brings you the latest on gadgets, gizmos and the new hits 
> in the gaming market. Try it now! <http://computing.in.msn.com/>
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Tutor maillist  -  Tutor at python.org
> http://mail.python.org/mailman/listinfo/tutor



More information about the Tutor mailing list