Sdk (@Nullable Sdk existingSdk) { if (existingSdk != null && !PythonSdkUtil.isRemote(existingSdk) && PythonSdkFlavor.getFlavor(existingSdk) instanceof CPythonSdkFlavor) { return existingSdk; } for (Sdk sdk : ContainerUtil.sorted(PythonSdkUtil.getAllSdks(), PreferredSdkComparator.INSTANCE)) { if (!PythonSdkUtil.isRemote(sdk)) { return sdk; } } return null; }