Ubuntu:
To install python3.6 in Ubuntu, follow this link
Now to create
pip install virtualenv
Run the below command to create virtual environment in the folder venv:
virtualenv -p python3.6 venv
You can activate the virtual environment and check the python version by running below commands:
source venv/bin/activate python --version
Deactivate virtual env by:
deactivate
Mac
To install python3 on mac follow this link
In mac it’s very easy to create the virtual environment, just run below command to create it in the folder venv:
python3 -m venv venv
You can activate the virtual environment and check the python version by running below commands:
source venv/bin/activate python --version
Deactivate virtual env by:
deactivate
P.S.
fish
If you are using fish instead of bash, then to activate virtual environment run the below command:
source venv/bin/activate.fish