Passa ai contenuti principali

python 2.4 and python 2.6 on ubuntu 12.10


For business reasons I am forced to use python 2.6 and python 2.4.
Compile the python on each  *buntu 12.10 machine that i have is a frustrating job. (some real, many virtual)
I made packages with checkinstall, these are not true ppa but maybe someone can find them useful.
I've also tested on Ubuntu 12.10 server and Lubuntu 12.10
First install the dependencies:

sudo apt-get install zlib1g libncurses5 libncursesw5 libc6 libbsd0 libreadline5 libreadline6 libsqlite3-0 bzip2 libgdbm3 libssl1.0.0

then download and install the packages:

sudo dpkg -i python2.6.deb
sudo dpkg -i python2.4.deb

(for now are hosted on dropbox doh!)

https://dl.dropbox.com/s/0cvh8jm7qcbq5py/python2.4.deb
https://dl.dropbox.com/s/jbdgbt2smu352ry/python2.6.deb

Everything is provided in the hope that it is useful to someone; but with no guarantee.
The paths are:

/opt/python-2.6.8/ (for python 2.6)
/opt/python-2.4.6/ (for python 2.4)

you can add to $PATH or make symlinks.

sudo ln -s /opt/python-2.4.6/bin/python2.4 /usr/bin/python2.4
sudo ln -s /opt/python-2.6.8/bin/python2.6 /usr/bin/python2.6

or even better using virtualenv, ex:

virtualenv -p /opt/python-2.6.8/bin/python --no-site-packages myenv
source myenv/bin/activate
(myenv)  ... your environment, your python, your packages.

I hope someday to have the time to create a real ppa with better packages.
The only supported architecture is i686, at least for the moment.

Build yourself!

(pre) sudo apt-get install build-essential zlib1g-dev libncurses5-dev libncursesw5-dev libc6-dev libbsd-dev libcurl4-openssl-dev libreadline-dev libreadline6-dev libsqlite3-dev libbz2-dev libgdbm-dev libssl-dev

for python 2.4.6

./configure --prefix=/opt/python-2.4.6/ --enable-unicode=ucs4 --with-ssl --without-tkinter

edit setup.py, change:

lib_dirs = self.compiler.library_dirs + [
    '/lib64', '/usr/lib64',
    '/lib', '/usr/lib',
    ]
 
to:

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

then:

make
sudo make install

for python 2.6.8

./configure --prefix=/opt/python-2.6.8/ --enable-unicode=ucs4 --with-ssl --without-tkinter

edit setup.py, change:

lib_dirs = self.compiler.library_dirs + [
    '/lib64', '/usr/lib64',
    '/lib', '/usr/lib',
    ]
 
to:

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

edit Modules/Setup, change:

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

to:

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

edit Modules/_ssl.c, change:

  else if (proto_version == PY_SSL_VERSION_SSL2)
        self->ctx = SSL_CTX_new(SSLv2_method()); /* Set up context */

to:

#ifndef OPENSSL_NO_SSL2
    else if (proto_version == PY_SSL_VERSION_SSL2)
        self->ctx = SSL_CTX_new(SSLv2_method()); /* Set up context */
#endif

then:

make
sudo make install

.....
good luck ;-)

TODO:

* find a better host
* a better english page
* an italian page
* more testing
* more check on deps
* 64bit version
* real package for ppa in chroot env

any help is appreciated. (thanks to Riccardo Lemmi for helping me on python, even at impossible hours.)

Commenti

Anonimo ha detto…
Ciao ho ricompilato senza modificare i sorgenti da lubuntu 12.10 con il comando
* ./configure --prefix=/opt/python-2.6.8/ --enable-unicode=ucs4
se ti servono i binari per 64 bit te li posso passare. Grazie e ciao.
mva ha detto…
Hi,

I've tried your method but at the end of the make I get:

Failed to find the necessary bits to build these modules:
_bsddb _curses _curses_panel
_hashlib _sqlite3 _ssl
_tkinter bsddb185 bz2
dbm dl gdbm
imageop linuxaudiodev ossaudiodev
readline sunaudiodev
To find the necessary bits, look in setup.py in detect_modules() for the module's name.


Failed to build these modules:
crypt nis


So, importing hashlib fails.

Any ideas?

Manu.
mva ha detto…
Solution is in AskUbuntu: http://askubuntu.com/questions/21547/what-are-the-packages-libraries-i-should-install-before-compiling-python-from-so

Post popolari in questo blog

Notebook senza Sistema operativo qualcosa si muove :)

Ok in passato ho recensito con piacere diversi notebook a basso costo con linux a bordo, ma oggi a causa di un cliente che necessitava di 4 notebook con freebsd (al momento non divago ma ci tornerò a breve) ho setacciato il web alla ricerca di notebook "degnamente potenti" ad un costo accessibile ho un bugdet di 2000 euro installazione compresa gh:(.. Be' in passato ho parlato bene di syspack, unieuro, mediaworld e tecnologie creative oggi prendiamo in esame monclik, allora da questo ottimo rivenditore ho trovato un notebook msi molto molto carino: Dimensioni schermo 15.4 Widescreen Tipo processore Core 2 Duo (Centrino Duo) Velocità del processore 1.7 GHz Memoria RAM 1 GB Hard disk 120 GB Peso (Kg) 2,87 Sistema operativo Non Presente Connessioni Ethernet e wireless Unità ottiche Masterizzatore DVD±RW Double Layer Webcam Non integrata Scheda grafica Intel GMA X3100 Un bel 15 e passa pollici :), gma x3100 che ha un ottimo supporto e un bel processore core 2 duo a 1,7 ghz il

osx e chm rigorosamente opensource

Per citare wikipedia: " Microsoft Compressed HTML Help o CHM è un formato proprietario per file di aiuto in linea, sviluppato da Microsoft e rilasciato nel 1997 come successore di Microsoft WinHelp. È stato rilasciato per la prima volta con Windows 98 ed è ancora distribuito e supportato sulla piattaforma Windows XP. I file HTML Help sono creati con appositi strumenti. Microsoft distribuisce l'HTML Help Workshop con le versioni supportate di Windows e lo rende disponibile gratuitamente per il download. Ci sono anche divers strumenti di terze parti ." Spesso e volentieri, per lavoro e per piacere, ci troviamo a dover leggere libri o documentazione tecnica in chm, visto che ultimamente mi trovo spesso ad utilizzare osx come piattaforma desktop principale spero che questa piccola recensione di quattro software opensource per la visualizzazione di questo formato possa essere utile a quanti utilizzano il sistema operativo della mela :) il primo software che presento è il mio p

CSS Callout for Bootstrap

A small css for the box-type "callout" similar to those used in the documentation of twitter bootstrap. (Boostrap is required :-)) /* callout like bootstrap docs */ .bs-callout { margin: 20px 0; padding: 15px 30px 15px 15px; border: 1px solid #eee; border-left: 5px solid #eee; border-radius: 3px; } .bs-callout h4 { margin-top: 0; } .bs-callout p:last-child { margin-bottom: 0; } .bs-callout code, .bs-callout .highlight { background-color: #fff; } .bs-callout-danger { border-left: 5px solid #dFb5b4; } .bs-callout-danger h4 { color: #B94A48; } .bs-callout-warning { border-left: 5px solid #C09853; } .bs-callout-warning h4 { color: #f1e7bc; } .bs-callout-info { border-left: 5px solid #d0e3f0; } .bs-callout-info h4 { color: #3A87AD; } .bs-callout-primary { border-left: 5px solid #285e8e; } .bs-callout-primary h4 { color: #428bca; } .bs-callout-