@Override
  public void jdkAdded(@NotNull final Sdk sdk) {
    if (sdk.getSdkType() instanceof PythonSdkType) {
      ApplicationManager.getApplication().invokeLater(() -> ApplicationManager.getApplication().runWriteAction(() -> {
        final ModifiableModelsProvider provider = ModifiableModelsProvider.getInstance();
        final LibraryTable.ModifiableModel libraryTableModifiableModel = provider.getLibraryTableModifiableModel();
        Library library = libraryTableModifiableModel.getLibraryByName(PythonFacetUtil.getFacetLibraryName(sdk.getName()));
        provider.disposeLibraryTableModifiableModel(libraryTableModifiableModel);
        if (library == null) {
          addLibrary(sdk);
        }
        else {
          // Library might already be created before listener invocation, e.g. by PythonFacetUtil.updateLibrary
          updateLibrary(sdk);
        }
      }));
    }
  }
@Override
  public void jdkAdded(@NotNull final Sdk sdk)