Jupyter Notebook Poetry-managed virtual environment libraries
-
CD into an exiting poetry managed project and add jupyter as dev dependency.
cd my_existing_project poetry add jupyter --group dev
-
Create/start a Poetry virtual environment
poetry shell
-
Install
ipykernel
if it’s not already installedpoetry add ipykernel --group dev
-
Create a new kernel linked to the virtual environment
python -m ipykernel install --user --name=my_project_kernel
-
Launch Jupyter Notebook
jupyter notebook
-
Select the Correct Kernel in Jupyter
- Once Jupyter Notebook is opened in your browser,
- create a new notebook or open an existing one.
- Then, change the kernel to the one you just created (my_project_kernel or whatever name you chose) by clicking on Kernel > Change kernel > my_project_kernel