how to create a env in python code example

Example 1: how to create a new virtualenv

to make a new virtualenv: 
virtualenv env_name

             to activate this virtual environment:
source env_name/bin/activate (on mac and linux)
source env_name/Scripts/activate (on windows)

Example 2: how to use virtual environment python

python3 -m pip install --user virtualenv

Example 3: python createvirtual env

python3 -m venv tutorial-env

Example 4: create an env in python

if you configured the PATH and PATHEXT variables for your Python installation:

c:\>python -m venv c:\path\to\myenv