Mumbai, India

dqureshiumar@gmail.com

Setup Virtual Environment in Python

Home  /  Setup Virtual Environment in Python

Using the Package Virtual Environment Wrapper to setup Virtual Environment

by Umar Qureshi


Prerequisite: You need to have python and pip installed on your Machine



Virtualenvwrapper is a set of extensions to Ian Bicking’s virtualenv tool.
The extensions include wrappers for creating and deleting virtual environments and otherwise managing your development workflow, making it easier to work on more than one project at a time without introducing conflicts in their dependencies.



Features

  1. Organizes all of your virtual environments in one place.
  2. Wrappers for managing your virtual environments (create, delete, copy).
  3. Use a single command to switch between environments.
  4. Tab completion for commands that take a virtual environment as argument.
  5. User-configurable hooks for all operations (see Per-User Customization).
  6. Plugin system for creating more sharable extensions (see Extending Virtualenvwrapper).



Below are the Steps to setup a Virtual Environment in python

  • Use the command "pip install virtualenvwrapper-win"


  • After successfully downloading the package use the command to make a new virtual environment :
    mkvirtualenv nameofyourvirtualenv
    (eg:- mkvirtualenv test)


    Virtual Environment


  • To Deactivate your virtual environment use following command :
    "deactivate nameofyourvirtualenv"
    Example : deactivate test


  • To Reacitvate your Virtual Environment you need to run the following command
    workon nameofyourvirtualenv
    Example : workon test





Once your Virtual Environment is successfully setup you can install the desired packages under that virtual environment and on deactivating it keeps the packages isolated from the other versions and also from the Operating system.



If any queries you can get back to dqureshiumar@gmail.com.
Hope you liked it.
Thank You.