Last Comment

Jon, Just run 'sudo ldconfig' ...

2012-11-27 @ 05:12:47 pm
by Admin

I get this after compileing trying ...

2012-11-27 @ 03:54:49 pm
by Jon

Nice article. That worked for me.

2012-11-27 @ 01:50:19 pm
by Arunroy


August 2017
 << < > >>

Who's Online?

Member: 0
Visitor: 1



No tags in this Blog

rss Syndication





    02:52:01 pm

    Python Virtualenv : A brief introduction

    Virtualenv is a python tool for creating isolated python environments. 'Virtualenv' is extremely useful for testing/installing python packages without affecting the other system(python) packages. Its very useful if you have two applications hosted on the same server & each of them are using different versions of django, sentry,celery etc.

    Here, in this article I will explain how to create virtualenv's & how we can use it effectively. Again, this narrates the installation & configuration of virtualenv on a Ubuntu box. For installing python libraries, we have 'two' alternate ways. One is to use 'easy_install' & other is 'pip'. I will be using 'pip'.

    First, we need to have some packges installed on our Ubuntu box. This includes python-setuptools, python-dev, build-essential,python-pip etc. That can be achieved by running the below command,

    sudo apt-get install python-setuptools python-pip python-dev build-essential

    Now, you are Good to Go.

    sudo pip install virtualenv

    The above command will install virtualenv for you. If you are behind a proxy, you have to specify your proxy machine's IP & Port in the pip install command. It will look like the one below,

    sudo pip install --proxy=proxy-ip:proxy-port virtualenv
    (Replace proxy-ip & proxy-port with appropriate values)

    Eg: sudo pip install --proxy= virtualenv

    If you not behind a proxy, you can skip the above step.

    Next, we need to create & activate the virtualenv. Prior to that, you must locate the place on your ubuntu box where you are going to create your custom virtualenv. Here, I will be creating the virtualenv under my 'Home Directory' say, /home/user.

    cd /home/user

    virtualenv --no-site-packages my-venv

    Here, 'my-venv' is the name of the virtualenv that we created. '--no-site-packages' will tell virtualenv not to symlink the global site packages into my local environment.

    Now, we need to activate the virtualenv.

    source /home/user/my-venv/bin/activate

    The above command will activate the 'my-venv' virtualenv. Now move inside the my-venv folder.

    cd /home/user/my-venv

    It will have some contents/folder like mentioned below,

    bin  include  lib  local

    cd bin ( Move to bin directory )


    The contents inside bin directory will look similar to the ones below,

    activate     easy_install      pip      python
    activate.csh  easy_install-2.7  pip-2.7

    Next, we can try installing django inside 'my-venv' virtualenv. At the moment we are inside /home/user/my-venv/bin directory, if not move inside that folder.

    ./pip install django

    If you need a partcular version of django say, 1.3, it can be achieved as follows,

    ./pip install django==1.3

    again, if you are behind a proxy,

    sudo pip install --proxy=proxy-ip:proxy-port django==1.3 (Replace proxy-ip & proxy-port with appropriate values)

    Eg: sudo pip install --proxy= django==1.3

    Similarly, you can create a number of virtualenv's to be used for separate applications.

    Now, when your need is over, you can safely deactivate the virtualenv. Issue the below command on the terminal,


    Note: The above instructions will work on Ubuntu machines only.

    Admin · 1347 views · 0 comments
    Categories: Cat, Tech

    Permanent link to full entry


    No Comment for this post yet...

    Leave a comment

    New feedback status: Awaiting moderation

    Your URL will be displayed.

    Please enter the code written in the picture.

    Comment text

       (Set cookies for name, e-mail and url)