diff --git a/src/sql/workbench/contrib/notebook/browser/notebook.contribution.ts b/src/sql/workbench/contrib/notebook/browser/notebook.contribution.ts index 0f15ace551..ccbf798929 100644 --- a/src/sql/workbench/contrib/notebook/browser/notebook.contribution.ts +++ b/src/sql/workbench/contrib/notebook/browser/notebook.contribution.ts @@ -182,7 +182,7 @@ CommandsRegistry.registerCommand({ for (let editor of editors) { if (editor instanceof NotebookInput) { let model: INotebookModel = editor.notebookModel; - if (model.providerId === 'jupyter') { + if (model.providerId === 'jupyter' && model.clientSession.isReady) { // Jupyter server needs to be restarted so that the correct Python installation is used if (!jupyterServerRestarted) { let jupyterNotebookManager: INotebookManager = model.notebookManagers.find(x => x.providerId === 'jupyter');