How to create a Python virtual environment.

On Windows

<pre lang="bash">
$ pip install venv
$ python3 -m venv ~/python-test

On Ubuntu

<pre lang="bash">
$ sudo apt install python3.8-venv
$ python3 -m venv ~/python-test

On Mac OS

<pre lang="bash">
$ brew install virtualenv
$ virtualenv python-test

Activate

<pre lang="bash">
$ cd ~/python-test
$ source bin/activate

Deactivate

<pre lang="bash">
$ deactivate