How to install Python in linux server

April 29, 2008 on 2:38 pm | In Installation, Python | No Comments

Easy…..

cd /usr/local/src
wget http://www.python.org/ftp/python/2.5/Python-2.5.tgz
tar -zxvf Python-2.5.tgz
make
make install

How to install Mod_Python in Linux server

April 29, 2008 on 2:35 pm | In Installation, Python | 2 Comments

Both instruction for Apache 1.x and Apache 2.x are given below.

First, you need to check what version of Python you are running.

python -V

If you are running Apache 1.3.x, you should use mod_python version 2.7.11 and for Apache 2.2.x, use 3.3.1.

Python with version 2.1.x greater than are only supported
latest is to use Python2.5.5

The step are for Apache 1.3.x. However, for Apache 2.1.x download mod_python 3.3.1 and follow the same steps

cd /usr/local/src
wget http://www.trieuvan.com/apache/httpd/modpython/mod_python-2.7.11.tgz
tar -xvzf mod_python-2.7.11.tgz
cd mod_python-2.7.11

./configure –with-apxs=/usr/local/apache/bin/apxs –with-python=/usr/local/bin/python

The –with-python path should reflect the location of the python binary

If you are on Apache 1.3, follow the steps below. If not, go for make and make install.

vi src/Makefile
Locate the ‘CFLAGS’ line, and add the -DEAPI switch so it looks like this:
CFLAGS=$(OPT) $(INCLUDES) -DEAPI

Then add -lutil to the LIBS line like so:
LIBS=-lm /usr/local/src/Python-2.5.1/libpython2.5.a -lutil

Run the make and make install.

This should be done. for both Apache versions.

Edit httpd.conf and create your handlers.

Apache 1.3.x
LoadModule python_module libexec/mod_python.so
AddModule mod_python.c
AddHandler mod_python .psp .py

Apache 2.1.x
LoadModule python_module modules/mod_python.so
AddHandler mod_python .psp .py

How to install docutils in Linux server

April 29, 2008 on 1:50 pm | In Installation, Python | No Comments

Download manually the docutils tar gz from http://prdownloads.sourceforge.net/docutils/docutils-0.4.tar.gz?download

cd /usr/local/src/
wget http://prdownloads.sourceforge.net/docutils/docutils-0.4.tar.gz?download

sudo easy_install /pathto/docutils-0.4.tar.gz

:)

How to install Python Imaging Library PIL on Linux server

April 29, 2008 on 1:47 pm | In Installation, Python | No Comments

Python Imaging Library (PIL)

Make sure Python is installed.

Prerequisites.

If you need any of the features described below, make sure you
have the necessary libraries before building PIL.

feature library
—————————————————————–
JPEG support libjpeg (6a or 6b)

http://www.ijg.org

http://www.ijg.org/files/jpegsrc.v6b.tar.gz

ftp://ftp.uu.net/graphics/jpeg/

PNG support zlib (1.1.4 or later is recommended)

http://www.gzip.org/zlib/

OpenType/TrueType freetype2 (2.1.3 or later is recommended)
support

http://www.freetype.org

http://freetype.sourceforge.net

Installation

Make sure Python is installed.

Then go for

wget http://effbot.org/downloads/Imaging-1.1.6.tar.gz
tar -zxf Imaging-1.1.6.tar.gz
cd Imaging-1.1.6/

python setup.py install

Thant’s all