Creating and using virtualenv

To create a virtualenv, run

virtualenv

On Ubuntu 18, this command will create virtualenv with Python 2.7.

To create virtualenv with Python 3, run

Here “venv” is my virtualenv name.

python3 virtualenv

To activate virtialenv, go to the folder where your virtialenv folder is present, then run

You will see name of your virtualenv on the command promt. To exit out of virtualenv, run

This can be run from any folder.

Install jupyter notebook

To install jupyter notebook on Ubuntu run

To start jupyter notebook, create an empty folder, change to it

Now run

By default, it bind to localhost. If you want to run on a public IP, run as follows

Example