在SuSE(SLES)11上使用全系统库安装干净的Python 2.6

我在这一天的大部分时间里都在度过,这让我绝对疯了。 在我用过的所有其他Unix上,这是在公园散步,但SLES 11让我目瞪口呆。

我需要在SLES 11 64位上构buildZope:

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. 

我不知道这里“不兼容”是指什么, 我的猜测是硬件架构,但我不确定什么是不符合上述声明。

我之前在系统安装的Pythons中遇到了问题,所以我试着编译自己的(因此上面列出的-devel包),下载Python 2.6 tarball并运行:

 ./configure --disable-tk --prefix=${HOME}/python make make install 

这样安装,但似乎无法find任何系统范围的库。 以下是一个示例解释器会话:

 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上,没有运气。

任何帮助非常感谢!

马丁

经过很多痛苦之后,丢失的部分是这样的:/usr/lib64/libpython2.6.so丢失了。 它应该是/usr/lib64/libpython2.6.so.1.0的一个符号链接,但不知何故,它会丢失或从未安装。

一个定制的Python仍然无法find某些库(例如libgcrypto或libopenssl),但是我设法使用SuSE提供的一个,使用virtualenv –no-site-packages来获得一个良好的python来获得一个原始的环境。

感谢那些帮助过的人,尤其是对IRC的Wichert,他解释了.so符号链接的东西。 😉

马丁,试图推动它,但当然我不显示在你的,把你的Python库放在一个目录(或符号链接),然后添加到您的PythonpathIE PYTHONPATH“/home/osc/pythonstuff/extra_python_lib_15.6.3”

或#adjust根据需要,您可以附加/添加到$ HOME / .bashrc或$ HOME / .profile
PYTHONPATH = $ PYTHONPATH =的/ usr / lib64下/ python2.6的/ somelib /

导出$ PYTHONPATH

它会然后find他们。

使用YuM也是一个好主意,因为Yast可能很糟糕,但是您需要使用这些指令来下载和安装(来自Fedora的好的.spec文件) http://ivan.kartik.sk/,因为OPenSuse软件包不是2.6兼容的&#x3002;

我使用YuM打赌一个干净的安装将工作正常,YasT可以有点奇怪,我也注意到/ lib和/ lib64混淆了解决简单符合/ usr / lib64到/ usr / lib或apro位置

和平

Asigottech

下载readline,从源代码编译,然后从源代码重新编译python。

和平

Asigottech

http://www.linuxforums.org/forum/suse-linux-help/156619-python-error-sles-no-module-name-readline.html

PS – Gentoo是你的朋友:)

噢,变老我猜:)以为你有.so在/ usr / lib64下呢?

很高兴sorting,记得Gentoo是coooler