How to install virtual environment with python 3 in Ubuntu

You have to install pip3 first. Then virtualenv with pip3 and then venv using python3.
Follow the commands as below 

sudo apt-get install python3-pip

sudo pip3 install virtualenv

virtualenv -p python3 venv

Use the following command to activate the venv

source venv/bin/activate