<html><body><div style="color:#000; background-color:#fff; font-family:times new roman, new york, times, serif;font-size:12pt"><div><span>Mauro, this was a very boring situation I had to handle some time ago.</span></div><div><br><span></span></div><div><span>After a long time I came up with this solution: include the snippet below before &lt;grok:grok package="." /&gt; in your configure.zcml. Soon you will learn that this way of handling files is not the best. I'm temporarily using an ancient version of dolmen.file (when it still depended on z3c.form). When the need comes, I'll probably have to write a package of my own since it seems people out there don't share this issue nor do they regarding a good solution.<br></span></div><div><span><br></span></div><div><span>&lt;!-- zope.file requirements --&gt;<br>&nbsp; &lt;include package="zope.browsermenu" file="meta.zcml" /&gt;<br>&nbsp; &lt;include package="zope.browsermenu" /&gt;<br>&nbsp;
 &lt;browser:menu id="zmi_views" title="ZMI Views" /&gt;<br>&nbsp; &lt;browser:menu id="zmi_actions" title="ZMI Actions" /&gt;</span></div><div><br></div><div><br></div>  <div style="font-family: times new roman, new york, times, serif; font-size: 12pt;"> <div style="font-family: times new roman, new york, times, serif; font-size: 12pt;"> <div dir="ltr"> <font face="Arial" size="2"> <hr size="1"></font>---------------------------------------------------------------------<br></div><br>Message: 1<br>Date: Tue, 22 May 2012 17:48:54 +0200<br>From: Mauro Boschi &lt;<a ymailto="mailto:me@monadic.org" href="mailto:me@monadic.org">me@monadic.org</a>&gt;<br>To: <a ymailto="mailto:grok-dev@zope.org" href="mailto:grok-dev@zope.org">grok-dev@zope.org</a><br>Subject: [Grok-dev] zope.app.file/zope.file buildout error<br>Message-ID: &lt;<a ymailto="mailto:CEA836D2-D16C-4185-B1D9-DD649514BCCE@monadic.org"
 href="mailto:CEA836D2-D16C-4185-B1D9-DD649514BCCE@monadic.org">CEA836D2-D16C-4185-B1D9-DD649514BCCE@monadic.org</a>&gt;<br>Content-Type: text/plain; charset="us-ascii"<br><br>Hi,<br>I've tried to run Music Tutorial but it doesn't work in <a target="_blank" href="http://song.py">song.py</a> 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! :(<br><br>with a new grokproject test<br><br>I've added in buildout.cfg:<br>&nbsp;&nbsp;&nbsp; [zope_conf]<br>&nbsp;&nbsp;&nbsp; recipe = collective.recipe.template<br>&nbsp;&nbsp;&nbsp; input = etc/zope.conf.in<br>&nbsp;&nbsp;&nbsp; output = ${buildout:parts-directory}/etc/zope.conf<br>&nbsp;&nbsp;&nbsp; filestorage = ${buildout:directory}/var/filestorage<br>&nbsp;&nbsp;&nbsp; blobstorage = ${buildout:directory}/var/blobstorage<br>&nbsp;&nbsp;&nbsp; devmode =
 on<br>&nbsp;&nbsp;&nbsp; extra =<br><br>#I've added the devmode line to resolve another error.<br><br>Then I've added in <a target="_blank" href="http://setup.py">setup.py</a>:<br>&nbsp; &nbsp; &nbsp; install_requires=['setuptools',<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 'grok',<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 'grokui.admin',<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 'fanstatic',<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 'zope.fanstatic',<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 'grokcore.chameleon',<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 'grokcore.startup',<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # Add extra requirements
 here<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 'zope.file',<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 'zope.mimetype',<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ],<br><br>bin/buildout run without errors but when grok startup: <br><br>bin/paster serve --reload parts/etc/debug.ini<br><br>It raises this error:<br>ConfigurationError: ('Invalid value for', 'menu', "ImportError: Couldn't import zmi_views, No module named zmi_views")<br>---<br>Complete output there: http://pastebin.com/4ttSuCYp<br><br><br>I've tried with zope.app.file part from the same how-to but it raises a different error:<br> File "/usr/lib/python2.7/email/mime/image.py", line 9, in &lt;module&gt;<br>&nbsp; &nbsp; import imghdr<br>RuntimeError: sys.path must be a list of directory names<br>---<br>Complete output there:
 http://pastebin.com/ysH1VRA7<br><br>Thanks!<br>Mauro<br>-------------- next part --------------<br>A non-text attachment was scrubbed...<br>Name: signature.asc<br>Type: application/pgp-signature<br>Size: 841 bytes<br>Desc: Message signed with OpenPGP using GPGMail<br>URL: &lt;http://mail.zope.org/pipermail/grok-dev/attachments/20120522/f4148505/attachment-0001.sig&gt;<br><br>------------------------------<br><br> </div> </div>  </div></body></html>