Plone 4.0.5统一安装程序在Ubuntu 11.04(natty)上因zip/zlib错误失败
我刚接触Plone,想在Ubuntu 11.04 Natty上用统一安装程序安装Plone 4.0.5。
我解压了安装程序,然后以root身份运行了./install.sh zeo
,结果出现了以下错误:
ZEO Cluster Install selected Detailed installation log being written to /tmp/Plone-4.0.5-UnifiedInstaller/install.log Root install method chosen. Will install for use by system user plone Installing Plone 4.0.5 at /usr/local/Plone User 'plone' already exists. No need to create it. Skipping libjpeg build Skipping zlib build Skipping readline build Installing Python 2.6.6. This takes a while... Traceback (most recent call last): File "", line 1, in LookupError: unknown encoding: zip Python zlib support is missing; something went wrong in the zlib or python build. Installation has failed. See the detailed installation log at /tmp/Plone-4.0.5-UnifiedInstaller/install.log to determine the cause.
我也安装了这些Ubuntu软件包:
apt-get install zlib1g zlib1g-dev zlibc libghc6-zlib-dev zlibc
install.log文件挺大的,我这里只提到zlib的相关内容:
Starting at Tue May 17 14:12:46 SAST 2011 configure: WARNING: unrecognized options: --with-readline, --with-zlib, --disable-tk, --with-cxx ... Failed to find the necessary bits to build these modules: _bsddb _sqlite3 _tkinter bsddb185 dbm gdbm sunaudiodev zlib To find the necessary bits, look in setup.py in detect_modules() for the module's name. Failed to build these modules: crypt nis ...
我在安装文件里找不到setup.py。
有没有什么建议或者我应该注意的地方?
谢谢。
5 个回答
让统一安装程序自己构建 zlib 是可行的,你只需要运行这个命令:./install.sh --libz=yes zeo
谢谢 - Plone 安装成功了。
根据这个链接和这个链接,我找到了这个关于 setup.py 的补丁
为了帮助其他新手,这里是如何应用这个补丁的方法:
你可以在这里查看补丁的原始文本,然后从diff...
那一行下面的第一行开始复制,一直到最后。把这些内容复制到一个文本文件里。为了方便说明,我们假设你把这个文件命名为/tmp/patch.txt
接下来,切换到解压后的统一安装程序文件的根目录,然后执行以下操作:
cd packages
tar xjf Python-2.6.6.tar.bz2
rm Python-2.6.6.tar.bz2
cd Python-2.6.6
patch < /tmp/patch.txt
如果补丁应用成功,你应该会看到:
patching file setup.py
Hunk #1 succeeded at 354 (offset 15 lines).
然后你需要把 Python 包重新打包成 tar 和 bzip2 格式:
cd ..
tar cjf Python-2.6.6.tar.bz2 Python-2.6.6
rm -r Python-2.6.6
现在再次运行安装程序,它应该能够找到构建统一安装程序中包含的 python2.6 所需的模块。
这是一个关于Python的disutils和新的multilib设置的问题。我在尝试从源代码构建Python并添加sqlite支持时也遇到了同样的问题。
你可以在setup.py的detect modules部分进行一些修改来解决这个问题。
http://bugs.python.org/issue9762
编辑:
要解决这个问题,可以在python的setup.py中修改lib_dirs
(大约在第408行),对于x86_64的机器,可以改成这样:
lib_dirs = self.compiler.library_dirs + [
'/lib64', '/usr/lib64',
'/lib', '/usr/lib', '/usr/lib/x86_64-linux-gnu',
]
(/usr/lib/x86_64-linux-gnu这个路径是缺失的)