When I encounter such situations, I generally avoid the package manager, especially if it would be awkward to break something, i.e. production server. Instead, I would go to Activestate and download their binary package:
https://www.activestate.com/activepython/downloads/
This is installed when you run a script that puts everything in a folder and does not touch any system files. In fact, you donβt even need root privileges to configure it. Then I change the name of the binary to something like apy26, add this folder to the end of PATH and start encoding. If you install packages using apy26 setup.py install , or if you use virtualenv and easyinstall, then you will have the same flexible python environment you need without touching the system standard python.
edits ... Recently, I did some work to create a portable binary Python for Linux, which should work on any distribution without external dependencies. This means that any binary shared libraries needed by the portable Python module are part of the assembly included in tarball and installed in the Python private structure. This way you can install Python for your application without interfering with the installed Python system.
My github site has a build script that has been thoroughly tested on Ubuntu Lucid 10.04 LTS on both 32 and 64 bits. I also built it on Debian Etch, but it was a long time ago, and I can not guarantee that I have not changed anything. The easiest way to do this is to simply put your choice of Ubuntu Lucid in a virtual machine, check the script on git clone git://github.com/wavetossed/pybuild.git , and then run the script.
Once you build it, use tarball on any latest Linux distribution. There is one small wrinkle moving it to a directory other than /data1/packages/python272 , which is that you must run the included patchelf to set the interpreter path BEFORE the directory engine. This affects any binaries in /data1/packages/python272/bin
All of this is based on building with RUNPATH and copying dependent shared libraries. Despite the fact that the script is in several files, it is actually one long script shell, located in the style of the / etc / rc.d directories.
Michael Dillon Oct. 16 '09 at 21:24 2009-10-16 21:24
source share