Skip to content

Python and related tools

pramode edited this page Apr 20, 2011 · 4 revisions

Installing python-dev

(This is essential for building tools depending on Python)

Run:

apt-get install python-dev

Installing Setuptools

Run:

apt-get install python-setuptools

Now, you will have the script `easy_install' ready.

Installing virtualenv

Just do:

easy_install virtualenv

and, virtualenv is ready!

Test this out:

virtualenv --no-site-packages pyland

This will create a new directory called `pyland' which will be our virtual environment

`Activate' the virtual environment

After changing over to the directory corresponding to the "virtual environment", execute:

source bin/activate

This will `activate' the virtual environment.

Installing psycopg2 under virtualenv

Download latest version from here: http://initd.org/psycopg/download/

The psycopg2 home page does not recommend installation using `easy_install'. So we build from source.

Here are the steps:

cd pyland (the virtual environment)
source bin/activate
mkdir src; tar xvf psycopg2-2.4
cd psycopg2-2.4
python setup.py install

Installing SQLAlchemy from source under virtualenv

Download latest stable version from here: http://www.sqlalchemy.org/download.html

Extract the source under the virtual environment and build (as explained above for psycopg2)