What is virtualenv, why we need it

For the starter (this is the opening post for the devopspy.com) let’s start with something basic, something confusing, something you see in almost every python code example i.e. virtual environment.
Python is an interpreted language, and for development all we need is a Python interpreter (included in Linux based OS – for Windows can be installed using the provided .msi). Like other programming languages Python has its own way of enhancements i.e. to use functionality not there by default, all we have to do is install the package, using any installation utility – pip (most common way), easy_install, or manual installation. These installed packages may termed as the requirements or the dependencies. These dependencies vary for every project – to get a project working all we need is the environment setup ( i.e. Python and the dependencies installed).

What is a virtual environment ?

is basically a separate Python interpreter with its own set of installed packages. As mentioned above the Python interpreter along with the installed packages make the environment – so we can have multiple Python environments on a single machine, the environments other the default are termed as virtual environment, which we need to create and activate before we can use (demonstrated later).

Continue reading “What is virtualenv, why we need it”