[Grok-dev] zope.app.file/zope.file buildout error

Uli Fouquet uli at gnufix.de
Tue May 22 23:13:20 UTC 2012


Hi Mauro,

On Tue, 22 May 2012 17:48:54 +0200 Mauro Boschi wrote:

> Hi,
> I've tried to run Music Tutorial but it doesn't work in song.py section ( http://grok.zope.org/documentation/tutorial/musical-performance-organizer-part-1 ). So I've tried zope.file how-to: http://grok.zope.org/documentation/how-to/uploading-file but it doesn't work too! :(
> 
> with a new grokproject test
> 
> I've added in buildout.cfg:
> 	[zope_conf]
> 	recipe = collective.recipe.template
> 	input = etc/zope.conf.in
> 	output = ${buildout:parts-directory}/etc/zope.conf
> 	filestorage = ${buildout:directory}/var/filestorage
> 	blobstorage = ${buildout:directory}/var/blobstorage
> 	devmode = on
> 	extra =
> 
> #I've added the devmode line to resolve another error.
> 
> Then I've added in setup.py:
>       install_requires=['setuptools',
>                         'grok',
>                         'grokui.admin',
>                         'fanstatic',
>                         'zope.fanstatic',
>                         'grokcore.chameleon',
>                         'grokcore.startup',
>                         # Add extra requirements here
>                         'zope.file',
>                         'zope.mimetype',
>                         ],
> 
> bin/buildout run without errors but when grok startup: 
> 
> bin/paster serve --reload parts/etc/debug.ini
> 
> It raises this error:
> ConfigurationError: ('Invalid value for', 'menu', "ImportError: Couldn't import zmi_views, No module named zmi_views")
> ---
> Complete output there: http://pastebin.com/4ttSuCYp

This one is because of zope.file trying to register menus for the ZMI
(Zope Management Interface). As the ZMI is gone from Grok (since v1.2, I
think) along with a huge pile of dependencies, you get this error.

To 'solve' it temporarily, i.e. to start the tutorial, you can switch
back to an older Grok version by modfiying buildout.cfg:

  [buildout]
  #extends = http://grok.zope.org/releaseinfo/1.5.4/versions.cfg
  # Use grok toolkit version 1.1
  extends = http://grok.zope.org/releaseinfo/1.1/versions.cfg

With current grokprojects this won't be enough as newer grokprojects
would require some new packages that did not exist at time of 1.1
release. You therefore have to pin some versions also in buildout.cfg:

  [versions]
  # Override versions here.
  zc.recipe.egg = 1.3.0
  zc.buildout = 1.5.0
  zope.fanstatic = 0.9
  megrok.layout = 1.0.1
  grokcore.startup = 1.0.2

helped here. After rerunning bin/buildout (maybe also python
bootstrap.py) you might be able to start the Zope instance again.

If you get some strange AttributeError while trying to restore an index:
remove all the Data.* files in var/filestorage/ and retry. This will, of
course, destroy all data already stored in the ZODB. So it's only an
option if you're evaluating and testing around.

This, however, is a workaround.

I think that zope.file shouldn't require ZMI-related registrations and
that it should be fixed. What do others think?


> I've tried with zope.app.file part from the same how-to but it raises a different error:
>  File "/usr/lib/python2.7/email/mime/image.py", line 9, in <module>
>     import imghdr
> RuntimeError: sys.path must be a list of directory names
> ---
> Complete output there: http://pastebin.com/ysH1VRA7

Looks like a similar problem with zope.app stuff, but I cannot really
say something useful concerning this.

Best regards,

-- 
Uli

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: OpenPGP digital signature
URL: <http://mail.zope.org/pipermail/grok-dev/attachments/20120523/3dfafbce/attachment.sig>


More information about the Grok-dev mailing list