[Zope-dev] Zope and python namespaces
Roch'e Compaan
roche@upfrontsystems.co.za
Mon, 12 Nov 2001 14:57:02 +0200
> > I wrote an external method that uses Graphite, Sping and PIL to
> > generate charts, but I ran into some namespace problems. Execution
> > of the external method fails because there is a clash in the namespa=
ce
> > between PIL and Zope. PIL has a module "ImageFile" and Zope does as
> > well. Even if I insert PIL's path explicitly as the
> first entry in
> > the path, Zope's ImageFile is still being used.
> >
> > How can I resolve this and what is the best strategy to avoid namesp=
ace
> > problems here?
> Use Pythons package feature, i.e. use
>
> import PIL
>
> PIL.ImageFile
I don't import ImageFile directly - it's imported by dependant PIL module=
s
and in all cases the Package is explicitly mentioned:
from PIL import ImageFile
Roch=E9