- Install virtualenvwrapper
$pip install virtualenvwrapper
- Create a new virtualenv
$mkvirtualenv -p python3 py3env
- Activate the virtualenv
$workon py3env
(py3env)$
- Then install jupyter within the active virtualenv
(py3env)$ pip install jupyter
- Jupyter comes with ipykernel, but somehow you manage to get an error due to ipykernel, then for reference ipykernel package can be installed using:
(py3env)$ pip install ipykernel
- Set up the kernel
(py3env)$ python -m ipykernel install --user --name py3env --display-name "Python3 (py3env)"
A new kernel defintion will be created under /home/user/.local/share/jupyter/kernels/py3env/kernel.json
- Start jupyter notebook (not needed activate the venv this step)
(py3env)$ jupyter notebook
or
$jupyter notebook
In the jupyter notebook dropdown menu: Kernel >> Change Kernel >> <list of kernels>
you should see Python3 (py3env) kernel