How to compile Python 2.4.6 using ssl, readline and zlib on Debian Lenny

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

I definitely need ssl support, and when I compile, I also want readline , of course. Finally, of course, I need zlib , otherwise ez_setup.py , etc. Will not work; I find it hard to find zlib .

I downloaded tarball from Python 2.4.6, included 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 is called:

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

make gives me some warnings at the end about crypt and nis , but make install does not give any errors. However, as a result, Python supports readline and ssl , but not zlib ; this way i cant use ez_setup.py to get setuptools / pip etc.

I tried both uncomment and re-exclude the line

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

from Setup.dist .

Some system packages that are installed:

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

Is there anything else I missed?

Refresh after clicking https://stackoverflow.com/a/312960/16 :

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 could not execute distribute_setup.py .

+3
source share
1 answer

I found a solution here :

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

 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 all this, starting with setup.py clean , and it worked.

+9
source

Source: https://habr.com/ru/post/986042/


All Articles