用buildout安装OpenERP服务器时遇到问题!

8 投票
3 回答
1566 浏览
提问于 2025-04-15 18:54

我正在尝试用buildout和我自己的代码来部署OpenERP。实际上,我想建立一个完整的部署结构,这样我就可以使用OpenERP以及自定义模块和补丁。

首先,在添加任何个人配置之前,我试图创建一个buildout,让它负责配置所有内容。

Buildout配置

我的buildout.cfg配置文件看起来是这样的:

[buildout]
parts = eggs
versions=versions
newest = false
extensions = lovely.buildouthttp
unzip = true
find-links =
       http://download.gna.org/pychart/
[versions]

[eggs]
recipe = zc.recipe.egg
interpreter = python
eggs =
     Paste
     PasteScript
     PasteDeploy
     psycopg2
     PyChart
     pydot
     openerp-server

配置问题

但是在尝试启动buildout时,我在安装最后需要的egg(openerp-server)时遇到了一些错误。

在我这边,它就是找不到这些模块,但它们在我的egg目录里:

Error: python module psycopg2 (PostgreSQL module) is required
Error: python module libxslt (libxslt python bindings) is required
Error: python module pychart (pychart module) is required
Error: python module pydot (pydot module) is required
error: Setup script exited with 1
An error occured when trying to install openerp-server 5.0.0-3. Look above this message for any errors that were output by easy_install.
Is this possible that openerp hardcoded the his searching path somewhere ?

easy_install,试试看

我决定尝试一个干净的虚拟环境,不与主站点的包有任何关系。但是在使用easy_install安装openerp-server时:

$ source openerp-python/bin/activate
$ easy_install openerp-server
...
  File "build/bdist.linux-i686/egg/pkg_resources.py", line 887, in extraction_error
pkg_resources.ExtractionError: Can't extract file(s) to egg cache

The following error occurred while trying to extract file(s) to the Python egg
cache:

  SandboxViolation: mkdir('/home/mlhamel/.python-eggs/psycopg2-2.0.13-py2.5-linux-x86_64.egg-tmp', 511) {}

无论我的机器上是否安装了psycopg2,我总是会收到错误信息。

系统配置

  • Ubuntu 9.10 x86-64
  • 尝试过Python 2.5/Python 2.6

3 个回答

0

我对buildout不太了解,但如果我要尝试制作一个OpenERP的安装程序,我会先看看Open Source Consulting提供的那个不错的版本。我用过,感觉还挺满意的。

我上次查看的时候,它没有设置CRM的邮件网关,不过我需要的其他功能都涵盖了。

1

为了说明一下:在Pypi上有一个适用于OpenERP的buildout配方

2

最近我做了这个:

不要尝试安装那个“egg”,openerp 其实并不标准。

我用了这个 buildout 的代码片段:

# get the openerp-stuff as a distutils package
[openerp-server]
recipe = zerokspot.recipe.distutils
urls = http://www.openerp.com/download/stable/source/openerp-server-5.0.6.tar.gz

# similar idea for the web component
[openerp-web]
recipe = zc.recipe.egg:scripts
find-links  = http://www.openerp.com/download/stable/source/openerp-web-5.0.6.tar.gz

# add some symlinks so you can run it out of bin
[server-symlinks]
recipe = cns.recipe.symlink
symlink =  ${buildout:parts-directory}/openerp-server/bin/openerp-server = ${buildout:bin-directory}

不过,关键是我并没有使用 virtualenv。用 buildout 的话其实不需要用 virtualenv。把 buildout 和 virtualenv 一起用就像是把特洛伊木马和拉美西斯放在一起……其中一个就够了,除非你……好吧,一个就够了。;)

对于这个特定的项目,我按照 Debian 的说明,通过 aptitude 安装了需要的库。这只是因为当时我对 buildout 还不太熟悉,其实也可以直接安装 psycopg2 模块。

这里有一些很好的说明。如果你不需要 django 的内容,可以忽略它。Dan Fairs 是个很棒的作者,也是很好的 buildout 教学者。值得一看。免责声明:我可是他的忠实粉丝,都是根据他的 buildout 使用经验来的。

我敢肯定你不想用 pypi 上的那个 egg,它对我来说从来没用过,openerp 也不是 egg 格式的,它是一个 distutils 包。

祝你好运!

撰写回答