I\'m trying to build multiple versions of python using Pythonbrew, but I\'m getting some test failures. This is on a VM running: Ubuntu 8.04 32bit
Currently, I manage to get pythonbrew working with 2.7.2 doing the following:
a) First, install all the dependencies needed to compile python.
'curl' # not for build, but for steps after
'build-essential',
'libbz2-dev',
'libsqlite3-dev',
'zlib1g-dev',
'libxml2-dev',
'libxslt1-dev',
'libreadline5', # lenny
'libreadline5-dev', # lenny
'libgdbm-dev',
'libgdb-dev',
'libxml2',
'libssl-dev',
'tk-dev',
'libgdbm-dev',
'libexpat1-dev',
'libncursesw5-dev'
b) Now install 2.7.2:
pythonbrew install --configure="--with-threads --enable-shared" -j2 -v 2.7.2
This installs, but is hit by the following bug:
/home/python-deploy/.pythonbrew/pythons/Python-2.7.2/bin/python: error while loading shared libraries: libpython2.7.so.1.0: cannot open shared object file: No such file or directory
*To avoid getting an error after the build when it tries to install setuptools, use the --no-setuptools option, and you might need to use --force on some platforms, as the gdb test fails due to an error in the test itself.
pythonbrew install --configure="--with-threads--enable-shared" \
--force \
--no-setuptools \
--jobs=2 \
--verbose 2.7.2
c) The easiest workaround is to do (with the correct path to your pythonbrew install):
pythonbrew use 2.7.2
export LD_LIBRARY_PATH=$HOME/.pythonbrew/pythons/Python-2.7.2/lib
or to add it permanently, put the pythonbrew lib path in a file placed under /etc/ld.so.conf.d and the path will be added at startup, or right away running ldconfig:
sudo echo /home/user/.pythonbrew/pythons/Python-2.7.2/lib >> /etc/ld.so.conf.d/pythonbrew.conf
sudo ldconfig
d) Install setuptools or distribute manually, i.e.
curl -O http://python-distribute.org/distribute_setup.py
python distribute_setup.py && easy_install pip
And you should be ready to go. Only tested with 2.7.2 on a vagrant debian lenny VM.