how to create a virtual environment with venv code example
Example 1: create a venv
# Create the virtual environment.
python -m venv venv
# Activate the env.
venv\Scripts\activate.bat
Example 2: activate venv in python
$ source ~/envs/tutorial-env/bin/activate
(tutorial-env) $ python
Python 3.5.1 (default, May 6 2016, 10:59:36)
...
>>> import sys
>>> sys.path
['', '/usr/local/lib/python35.zip', ...,
'~/envs/tutorial-env/lib/python3.5/site-packages']
>>>