Creating a Python virtual environment on Windows and Linux

Python Methods and Functions

Virtual Environment — it is a Python environment, that is, an isolated working copy of Python that allows you to work on a specific project without affecting other projects. 
So basically it's a tool that allows multiple parallel installations of Python, one for each project.

Create a virtual environment in Linux

If pip is not present on your system

 $ sudo apt-get install python-pip 

Then install virtualenv

 $ pip install virtualenv 

Now check your installation

 $ virtualenv --version 

Create a virtual environment now,

 $ virtualenv virtualenv_name 

After This command will create a folder named virtualenv_name . You can name anything to it. If you want to create a virtualenv for a specific Python version, enter

 $ virtualenv -p / usr / bin / python3 virtualenv_name 

or

 $ virtualenv -p / usr /bin/python2.7 virtualenv_name 

Now finally we just need to activate it using the command

 $ source virtualenv_name / bin / activate 

Now you are in Python virtual environment

You can disable with

 $ deactivate 

Create Python virtualenv on Windows

If you have python installed on your system, pip comes in handy. 
Here are some simple steps:
1) Install virtualenv using





Tutorials