简体   繁体   English

在Windows上将Plone egg安装为Python模块

[英]Install Plone egg as a Python module on Windows

I have a Plone site (Plone version 3.1.2) that I need to install a product called GrufSpaces on - ( http://plone.org/products/grufspaces ). 我有一个Plone网站(Plone版本3.1.2),我需要在-( http://plone.org/products/grufspaces )上安装一个名为GrufSpaces的产品。 However, it is a production site and so I can't easily take it down to upgrade Plone to 3.2+ in order to use buildout; 但是,这是一个生产站点,因此我无法轻易将其升级到Plone到3.2+以使用buildout。 using buildout would allow me to easily add Grufspaces (collective.groupspace.roles etc) as a Product. 使用buildout使我可以轻松地将Grufspaces(collective.groupspace.roles等)添加为产品。

I have downloaded the egg files separately (roles, workflow, mail, content) and placed them in a directory structure like so: 我已经分别下载了鸡蛋文件(角色,工作流,邮件,内容),并将它们放置在目录结构中,如下所示:

  • collective/ 集体/
    • __init__.py __init__.py
    • groupspace/ 组空间/
      • __init__.py __init__.py
      • content/... 内容/...
      • roles/... 角色/ ...
      • workflow/… 工作流程/…
      • mail/... 邮件/...

What I thought I could do is add this "collective" folder to [plone directory]/Zope/lib/python as a Python module. 我想我能做的就是将这个“ collective”文件夹作为Python模块添加到[plone directory] ​​/ Zope / lib / python中。 The idea being once its added I can restart Plone/Zope and it will automatically pick it up and make it available within Plone as a Python Module. 一旦添加了这个主意,我就可以重新启动Plone / Zope,它会自动将其拾取并在Plone中作为Python模块提供。 Unfortunately it has not worked as of yet. 不幸的是,它到目前为止还没有起作用。

If I am going about this the wrong way I welcome any suggestion to try this a different way. 如果我以错误的方式进行操作,我欢迎提出任何尝试以其他方式尝试的建议。

Did you check GrufSpaces' INSTALL.TXT? 您检查了GrufSpaces的INSTALL.TXT吗? From there: 从那里:

Unpack it into your Zope Products Folder 将其解压缩到您的Zope产品文件夹中

For Plone, the easiest way is probably to unpack it the top level products folder. 对于Plone,最简单的方法可能是解压缩顶级products文件夹。

See also http://plone.org/documentation/kb/third-party-products/installing , section "Installing Zope 2-style Products Without Buildout". 另请参见http://plone.org/documentation/kb/third-party-products/installing的 “在没有构建的情况下安装Zope 2样式的产品”部分。

If you are trying to install GrufSpaces 2.0 then you should consider upgrading to Plone 3.3 (see the install requirements ) 如果尝试安装GrufSpaces 2.0,则应考虑升级到Plone 3.3(请参阅安装要求

Placing the collective.* packages to [plone directory]/Zope/lib/python should work. 将collection。*软件包放置到[plone directory]/Zope/lib/python应该可以。 But these packages are not compatible with Plone 3.1. 但是这些软件包与Plone 3.1不兼容。 Here is the example of ImportError that I get when using collective.groupspace.roles with Plone 3.1: 这是将Plone 3.1与Collector.groupspace.roles结合使用时出现的ImportError的示例:

  File "/home/andrey/tmp/zope/instance/lib/python/collective/groupspace/roles/browser/roles.py", line 23, in ?
    from plone.app.workflow import PloneMessageFactory as _
zope.configuration.xmlconfig.ZopeXMLConfigurationError: File "/home/andrey/tmp/zope/instance/etc/site.zcml", line 15.2-15.23
    ZopeXMLConfigurationError: File "/home/andrey/tmp/zope/instance/Products/GrufSpaces/configure.zcml", line 17.4-17.53
    ZopeXMLConfigurationError: File "/home/andrey/tmp/zope/instance/lib/python/collective/groupspace/roles/configure.zcml", line 7.4-7.34
    ZopeXMLConfigurationError: File "/home/andrey/tmp/zope/instance/lib/python/collective/groupspace/roles/browser/configure.zcml", line 5.4-10.10
    ImportError: cannot import name PloneMessageFactory

Besides collective.* packages you have to download GrufSpaces product from SVN (download link at plone.org doesn't work for me) and place it in Products folder. 除了collection。*软件包之外,您还必须从SVN下载GrufSpaces产品(plone.org上的下载链接对我不起作用)并将其放在Products文件夹中。

No advice specific to GruffSpaces as I've never used it but it sounds like you may be under the mistaken impression that you need Plone 3.2+ for buildout. 没有针对GruffSpaces的建议,因为我从未使用过,但是听起来您可能会误以为您需要使用Plone 3.2+进行构建。 This is incorrect. 这是不正确的。 Buildout works just fine with Plone 3.1.2. Buildout在Plone 3.1.2中可以正常工作。 I've also done buildouts for Plone 2.5.5 and even one for Plone 2.1 (although this last one was a bit tricky because the required python for that version doesn't do buildout). 我也为Plone 2.5.5完成了扩展,甚至为Plone 2.1也完成了扩展(尽管最后一个有点棘手,因为该版本所需的python并没有进行扩展)。

So if you prefer the buildout route, just do it. 因此,如果您喜欢扩建路线,那就去做吧。 Although upgrading your Plone is probably still good advice. 尽管升级您的Plone可能仍然是不错的建议。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM