Quick upgrade (CentOS)

 yum upgrade python

As latest version in repository may not be the latest production one, you may prefer to install from source.

Linux install from source

# wget http://dinsdale.python.org/ftp/python/2.6.2/Python-2.6.2.tar.bz2
# tar xvfj Python-2.6.2.tar.bz2
# cd Python-2.6.2
# ./configure
# make
# make install

Eventually make old installation unusable (quick & dirty way)

# cd /usr/bin
# mv python python_2.4.3


# python
Python 2.6.2 (r262:71600, Aug  9 2009, 11:59:09)
[GCC 4.1.2 20080704 (Red Hat 4.1.2-44)] on linux2
Type "help", "copyright", "credits" or "license" for more information.

EasyInstall installation

The short way

# wget https://bitbucket.org/pypa/setuptools/raw/bootstrap/ez_setup.py -O - | python

[OLD PROCEDURE] Sample for Python 2.4

# cd /root/depot
# wget http://pypi.python.org/packages/2.4/s/setuptools/setuptools-0.6c9-py2.4.egg#md5=260a2be2e5388d66bdaee06abec6342a
# sh setuptools-0.6c9-py2.4.egg


# easy_install
error: No urls, filenames, or requirements specified (see --help)

Apache mod_python



 aptitude install libapache2-mod-python 

(this loads the module in apache by default)


Add to apache conf:

<Location /mpinfo>
   SetHandler mod_python
   PythonInterpreter main_interpreter
   PythonHandler mod_python.testhandler

& test URL /mpinfo

Python (last edited 2013-07-27 08:02:43 by JaumeSola)