Код: Выделить всё
from fastapi import FastAPI, HTTPException, Body
from jupyter_client import KernelManager
from jupyter_client.blocking.client import BlockingKernelClient
app = FastAPI()
km = KernelManager(kernel_name="python3")
client: BlockingKernelClient = km.blocking_client()
Подробнее здесь: https://stackoverflow.com/questions/768 ... ing-as-any