One of the most important things to be aware of is installing the correct version of the tools:
Using the current 2.91 Blender version we should use Python 3.7. We can install that using Anaconda3 2020.02 from exe, list of packages.
After that we need to install the blender kernel from here, using the following command in anaconda terminal:
python -m pip install blender_notebook
blender_notebook install --blender-exec="C:\Program Files\Blender Foundation\Blender 2.91\blender.exe"
Now, when we start Jupyter Notebook we can select blender kernel.
First, you need to import the Blender specific library bpy
:
# blender related imports
import bpy
After that, we are able to use many examples, already available out there.
I've made an example Jupyter Notebook on this topic, available here
See the discussion and plans on updating blender's python version here.
Update:
Blender 2.93: Python was upgraded to version 3.9.1. link