A Primer on virtualenv

Found this really amazing blog that tells one everything there is to know about setting up a virtual environment in Python.
Virtual environments can be really useful. It basically provides the user with an isolated working copy of the Python environment, allowing the user to work on a separate project. The packages installed during a virtual environment does the not affect the global Python installation, thereby keeping the machine clean.

Read on to learn more about it.

Chris Scott

What is virtualenv and Why Should You Use It?

Put simply (and copied from the project page), virtualenv is a tool to create isolated Python environments. Why is this good? You can create a new Python environment to run a Python/Django/whatever app and install all package dependencies into the virtualenv without affecting your system’s site-packages. Need to upgrade a package to see how it affects your app? Create a new virtualenv, install/copy your app into it, run your tests, and delete it when you are done. Just like git makes branching inexpensive and easy, virtualenv makes creating and managing new Python environments inexpensive and easy.

Show Me Some Code!

First, you need to install virtualenv. The typical way to install is from PyPi using easy_install. You can also use pip or install from source. We’ll use easy_install since it is…easy:

$ sudo easy_install virtualenv Password: Searching for virtualenv Best…

View original post 741 more words

Advertisements

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 )

Google+ photo

You are commenting using your Google+ 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 )

Connecting to %s