我花了一天的大部分时间在这上面,这让我非常疯狂。在我使用过的所有其他 Unix 上,这是在公园里散步,但 SLES 11 让我目瞪口呆。
我需要在 SLES 11 64 位上构建 Zope:
Linux <name> 2.6.27.45-0.1-default #1 SMP 2010-02-22 16:49:47 +0100 x86_64 x86_64 x86_64 GNU/Linux
我首先尝试只使用安装了 YaST 的 Python 2.6。我还安装了 python-devel、libjpeg-devel、readline-devel、libopenssl-devel、libz2-devel、zlib-devel 和 libgcrypt-devel。
全局python2.6里面有很多杂物,当我使用它时似乎在/etc/pythonstart中执行了一些东西,这没有帮助。但是,我得到的错误是:
Getting distribution for 'Zope2==2.12.3'.
src/AccessControl/cAccessControl.c:596: warning: initialization from incompatible pointer type
src/AccessControl/cAccessControl.c:598: warning: ‘intargfunc’ is deprecated
src/AccessControl/cAccessControl.c:598: warning: initialization from incompatible pointer type
src/AccessControl/cAccessControl.c:599: warning: ‘intargfunc’ is deprecated
src/AccessControl/cAccessControl.c:599: warning: initialization from incompatible pointer type
src/AccessControl/cAccessControl.c:600: warning: ‘intintargfunc’ is deprecated
src/AccessControl/cAccessControl.c:600: warning: initialization from incompatible pointer type
src/AccessControl/cAccessControl.c:601: warning: initialization from incompatible pointer type
src/AccessControl/cAccessControl.c:602: warning: initialization from incompatible pointer type
src/AccessControl/cAccessControl.c:606: warning: ‘intargfunc’ is deprecated
src/AccessControl/cAccessControl.c:606: warning: initialization from incompatible pointer type
/usr/lib64/gcc/x86_64-suse-linux/4.3/../../../../x86_64-suse-linux/bin/ld: skipping incompatible /usr/lib/libpython2.6.so when searching for -lpython2.6
/usr/lib64/gcc/x86_64-suse-linux/4.3/../../../../x86_64-suse-linux/bin/ld: cannot find -lpython2.6
collect2: ld returned 1 exit status
error: Setup script exited with error: command 'gcc' failed with exit status 1
An error occured when trying to install Zope2 2.12.3. Look above this message for any errors that were output by easy_install.
我不知道这里的“不兼容”指的是什么;我的猜测是硬件架构,但我不确定什么与上面的陈述不兼容。
我以前在系统安装的 Python 上遇到过问题,所以我尝试编译自己的(因此是上面的 -devel 包列表),下载 Python 2.6 tarball 并运行:
./configure --disable-tk --prefix=${HOME}/python
make
make install
这会安装,但似乎无法找到任何系统范围的库。这是一个示例解释器会话:
Python 2.6.5 (r265:79063, Mar 29 2010, 17:04:12)
[GCC 4.3.2 [gcc-4_3-branch revision 141291]] on linux2
Type "help", "copyright", "credits" or "license" for more information.
Traceback (most recent call last):
File "/etc/pythonstart", line 7, in <module>
import readline
ImportError: No module named readline
>>> from hashlib import md5
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/osc/python-2.6/lib/python2.6/hashlib.py", line 136, in <module>
md5 = __get_builtin_constructor('md5')
File "/home/osc/python-2.6/lib/python2.6/hashlib.py", line 63, in __get_builtin_constructor
import _md5
ImportError: No module named _md5
应该安装 readline 和 hashlib(通过 libgrypt),并且还安装了相关的 -devel 包。在 Ubuntu 或 OS X 上,这工作得很好。在 SuSE 上,没有运气。
非常感谢任何帮助!
马丁