如何使用ssl,readline和zlib在Debian Lenny上编译Python 2.4.6 [英] How to compile Python 2.4.6 with ssl, readline and zlib on Debian Lenny

查看:107
本文介绍了如何使用ssl,readline和zlib在Debian Lenny上编译Python 2.4.6的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个虚拟Linux盒子与Debian 7.1,我需要一个Python 2.4.6来重新生成一个旧的Zope安装(为了更新到Plone 4,当然)。



我绝对需要 ssl 支持,当我编译时,我还需要 readline 当然。最后,当然我需要 zlib ,否则 ez_setup.py 等将无法正常工作;我很难得到包含 zlib



我下载了Python 2.4.6的tarball,在 Modules / Setup.dist 中启用 ssl

  SSL = / usr / local / ssl 
_ssl _ssl.c \
-DUSE_SSL -I $(SSL)/ include -I $(SSL)/ include / openssl \
-L ​​$(SSL)/ lib -lssl -lcrypto

并且调用:

  ./ configure --prefix = / my / dest / dir --with-zlib 
使

make 给我一些警告结束关于 crypt nis ,但是 make install doesn'不会产生任何错误。但是,所产生的Python特性既支持 readline ssl 支持,但没有 zlib ;因此,我不能使用 ez_setup.py 来获取setuptools / pip等。



我尝试取消注释并重新排除该行

  zlib zlibmodule.c -I $(prefix)/ include -L $(exec_prefix)/ lib从$ code> Setup.dist   

/ p>

安装的某些系统软件包:




  • zlib1g -dev

  • lib32z1-dev

  • libreadline-gplv2-dev



还有什么我错过的?



更新后,阅读 http://stackoverflow.com / a / 4047583/1051649



我做了

  $ sudo apt-get install zlib1g zlib1g-dev libncurses5-dev libreadline6-dev ncurses-doc 
$ python setup.py clean
$ ./configure --with-ssl --with-zlib - -prefix = ...
$ make
$ sudo make install

最终的解释器无法执行 distribute_setup.py

解决方案

我发现解决方案 here



我更改了 setup.py ,寻找lib_dirs变量的第一个赋值,如下所示: p>

  lib_dirs = self.compiler.library_dirs + [
'/ lib64','/ usr / lib64',
'/ lib','/ usr / lib',
'/ usr / lib / x86_64-linux-gnu',#added
'/ usr / lib / i386-linux-gnu'添加
]

然后我重复了整个事情,从 setup.py clean ,它的工作。


I have a virtual Linux box with Debian 7.1 where I need a Python 2.4.6 to reanimate an old Zope installation (in order to update it to Plone 4, of course).

I definitely need ssl support, and when I'm compiling, I want readline as well, of course. Finally, of course I need zlib, otherwise ez_setup.py etc. won't work; I'm having a hard time to get zlib included.

I downloaded the tarball of Python 2.4.6, enabled ssl in Modules/Setup.dist:

SSL=/usr/local/ssl
_ssl _ssl.c \
        -DUSE_SSL -I$(SSL)/include -I$(SSL)/include/openssl \
        -L$(SSL)/lib -lssl -lcrypto

... and called:

./configure  --prefix=/my/dest/dir --with-zlib
make

make gives me some warnings at the end about crypt and nis, but make install doesn't yield any errors. However, the resulting Python features both readline and ssl support, but no zlib; thus, I can't use ez_setup.py to get setuptools/pip etc.

I tried both to uncomment and re-exclude the line

zlib zlibmodule.c -I$(prefix)/include -L$(exec_prefix)/lib -lz

from Setup.dist.

Some system packages which are installed:

  • zlib1g-dev
  • lib32z1-dev
  • libreadline-gplv2-dev

Is there anything else I have missed?

Update, after heaving read http://stackoverflow.com/a/4047583/1051649:

I did

$ sudo apt-get install zlib1g zlib1g-dev libncurses5-dev libreadline6-dev ncurses-doc
$ python setup.py clean
$ ./configure --with-ssl --with-zlib --prefix=...
$ make
$ sudo make install

The resulting interpreter was not able to execute distribute_setup.py.

解决方案

I found the solution here:

I changed setup.py, looking for the first assignment to the lib_dirs variable, changing it like so:

lib_dirs = self.compiler.library_dirs + [
'/lib64', '/usr/lib64',
'/lib', '/usr/lib',
'/usr/lib/x86_64-linux-gnu',   # added
'/usr/lib/i386-linux-gnu',     # added
]

Then I repeated the whole thing, starting with setup.py clean, and it worked.

这篇关于如何使用ssl,readline和zlib在Debian Lenny上编译Python 2.4.6的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆