I did this, made it work, and then a week later I had to redo the research because I could not remember how to do it... (so, here we are)
Steps to create a virtual environment, install jupyter notebook and use it
Why?
At the time of writing, I have Python 3.11 installed on my Mac, but Jupyter Notebooks do not appear to work with this version of python yet. There are other advantages of using a virtual environment, such as easily being able to install multiple packages and not worrying if they will screw up other scripts that you run from outside a virtual environment.
Steps
Create a 'root' directory to house your project files / notebooks and virtual environment
mkdir my_new_project_rootenter the directory
cd my_new_projectI am on macOS, create the virtual environment using python 3.9
python3.9 -m venv my_new_projectactivate the virtual environment
source my_new_project/bin/activateinstall jupyter notebook
pip3 install jupyterInstall ipykernel
pip3 install ipykernelInstall a Jupyter kernel in your virtual environment
python -m ipykernel install --user --name=my_new_projectlaunch jupyter notebook using the virtual environment python version
python -m jupyter notebook