help me understand the shell script

help me to understand the below lines in below shell script..

Why we need to use virtualenv "$ANSIBLE_ROOT" .... and what is the use of virtualenv here ....

and how activate and deactivate worked ...i am bit confused how activate and deactivate keywords worked here..
. "$ANSIBLE_ROOT/bin/activate"

and also how pip works with -i option...i.e. below

pip install docker-compose==1.15.0 -i

#!/usr/bin/env sh

scl enable python27 bash <<!
set -e
export https_proxy=
if [ ! -d "$ANSIBLE_ROOT/bin" ]
    virtualenv "$ANSIBLE_ROOT"
    . "$ANSIBLE_ROOT/bin/activate"
    echo "Installing latest version of ansible"
    pip install ansible -i
    pip install docker-py -i
    pip install docker-compose==1.15.0 -i

Open in new window

BharathKumarRaju DasaraRajuDevops EngineerAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Swadhin Ray Commented:
Never used this but " virtualenv " command is usually used to create an isolated virtual environment on any instance.
Hope this below link will help you to understand more.
Let other experts also comment on this :

Open in new window

And "i" stands for ignore the installed packages (reinstalling instead).

here is the link for getting all PIP related details:

Open in new window

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
BharathKumarRaju DasaraRajuDevops EngineerAuthor Commented:
Thank you
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.