-
Ensure that the requirement for working with envs are installed
sudo apt install python3-venv
-
Work out the python version you want to work with
python --version
orpython3 --version
orwhich python
-
Once you have chosen the python version
cd
to the directory you want the env to be stored in -
run
/path/to/my/python3 -m venv nameOfEnv
of course this may just bepython
notpython3
- in my case
/usr/bin/python3
- in my case
-
Then activate the env with
source nameOfEnv/bin/activate
-
Install the IPython Kernel
(nameOfEnv)$ pip install ipykernel
-
Install the env to jupyter notebook
(nameOfEnv)$ python -m ipykernel install --user --name nameOfEnv --display-name "Python3.x (nameOf)"
-
When inside the env use
pip install package_name
and not other variations -
if it exists then
pip install -r requirements.txt
It should now appear as kernel in the jupyter lab interface