Python virtualenv?

We always use different version of libraries in our projects as per requirement, it means we need project environments supporting local installation of packages and avoid usage of globally installed packages. virtualenv i.e. Virtual Environment, is solutions to above problem as it maintain a separate copy of Python and libs utilized in your python project. Let’s try installtion and create a simple virtual environment using following steps.

  1. Installation – sudo pip installvirtualenv
  2. Create new environment for a project – virtualenv envname
  3. activate your new env by running commands –
    • Mac OS/ Ubuntu – source envname/bin/activate

Leave a comment

Your email address will not be published. Required fields are marked *