Skip to content

VirtualEnv

September 18, 2012

What is VirtualEnv?

VirtualEnv is a tool which can be used to create isolcated Python environments. The basic problem being addressed is one of dependencies and versions, and indirectly permissions. Imagine you have an application that needs version 1 of LibFoo, but another application requires version 2. How can you use both these applications? If you install everything into/usr/lib/python2.7/site-packages (or whatever your platform’s standard location is), it’s easy to end up in a situation where you unintentionally upgrade an application that shouldn’t be upgraded.

Installation Steps:

Note: You need python 2.7 installed. If you need to install it you can follow the instructions here.

  • If you have PIP installed (if you would like to install it you can follow the instructions here)
    $ sudo pip install virtualenv
  • If you have easy_install installed  (if you would like to install it you can follow the instructions here)
    $ sudo easy_install virtualenv

Basic Usage

Create Virtual Environment:


$ sudo virtualenv /path/to/new/virtualenv

Start Virtual Environment:


$ source /path/to/new/virtualenv/bin/activate

Advertisements

From → Installation

Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: