Personal tools
You are here: Home Documentation Error References No such file or directory: 'images/version.gif'
Support

Get Help

Join our chat rooms or support forums if you have more specific questions.

Plone Training
Learn how to design, build, and deploy a website in Plone through one of the numerous Plone training sessions around the world.
Find Plone training…
 
Document Actions

No such file or directory: 'images/version.gif'

Warning: This item is marked as outdated.

This Error Reference applies to: Plone 2.1.x
This Error Reference is intended for: Any audience.

When launching Zope in debug mode, Zope refuses to start because of broken product OFSP. Traceback claims that image file is missing.

Traceback

2006-01-26 00:20:27 ERROR Zope Could not import Products.OFSP
Traceback (most recent call last):
  File "F:\usability\Test\Plone21\Zope\lib\python\OFS\Application.py", line 695, in import_product
    product=__import__(pname, global_dict, global_dict, silly)
  File "F:\usability\Test\Plone21\Zope\lib\python\Products\OFSP\__init__.py", line 43, in ?
    misc_={
  File "F:\usability\Test\Plone21\Python\lib\site-packages\PIL\ImageFile.py", line 71, in __init__
    self.fp = open(fp, "rb")
IOError: [Errno 2] No such file or directory: 'images/version.gif'

This breaks at least Zope's OFSP and SiteLog product. Broken products prevent Zope to be launched in debug mode.

Answer

Dieter Mauer gave a helpful answer at Zope mailing list

Zope has itself an "ImageFile" module.
Apparently, mistakenly, the "PIL" "ImageFile" is used instead.
And it behaves very differently.

Obviously, "PIL" is before Zope's software home in your "PYTHONPATH" (aka
"sys.path"). Try to prevent this...

Your PYTHONPATH includes Plone first, then Zope. This in incorrect order, because Zope 2.8.0+

Both Zope and PIL have module called ImageFile. ATContentTypes, thus Plone 2.1, depend on PIL.

PIL should be installed in your-python-interpreter/lib/site-packages/PIL.

In normal conditions PIL should not interfere PYTHONPATH since Python uses different look-up mechanisms for modules located in site-packages; site-packages modules work without adding them to PYTHONPATH explictly.

However, some IDEs and other tools, which allow the user to configure many different Python interpreters and PYTHONPATHS, may force site-packages included in PYTHONPATH so that it's overrides normal safe site-packages importing. Also, one might want to use different installation/configuration than one located in site-packages for PIL and thus needs put PIL to PYTHONPATH.


Solution

Easy way

Do not put your-python/site-packages/PIL to PYTHONPATH. Python interpreter should find these files without PIL in PYTHONPATH, if proper importing is used and there is no collision with Zope ImageFile.

Hard way

Read this if easy way failed...

Edit Zope products which include Zope's image file

Orignal:

from ImageFile import ImageFile

Modified:

from Globals import ImageFile

(don't import ImageFile module directly)

Places needing adjustment:

  • Products/OFSP/__init__.py
  • Products/SiteErrorLog/__init__.py
by Mikko Ohtamaa last modified February 7, 2006 - 12:41
Contributors: Mikko Ohtamaa, Dieter Mauer
All content is copyright Plone Foundation and the individual contributors.

I believe this should be reported in the Zope bug tracker

Posted by Alexander Limi at January 26, 2006 - 23:07
...as it is not a Plone bug as such, and definitely needs to be fixed. PIL is a very common Python component, if Zope has problems co-existing with it, something needs to be done.

setuptools

Posted by Jonah Bossewitch at May 23, 2006 - 18:43

and be extra careful - if you install PIL using easy_install, it will automatically add PIL to your pythonpath. I was able to remove it from /usr/lib/python2.4/site-packages/easy-install.pth, and things worked again.


For any issues with the web site functionality, please file a ticket.

Please consult the policy on plone.org content if you want your content published on this site.

Servers and hosting by