open jupyter notebook in a virtual environment code example
Example: jupyter notebook virtualenv
$ python -m venv projectname
$ source projectname/bin/activate
(venv) $ pip install ipykernel
(venv) $ ipython kernel install --user --name=projectname