String (@NotNull DataContext dataContext) { Module module = PlatformCoreDataKeys.MODULE.getData(dataContext); if (module == null) { Project project = CommonDataKeys.PROJECT.getData(dataContext); if (project == null) { return null; } Module[] modules = ModuleManager.getInstance(project).getModules(); if (modules.length == 0) { return null; } module = modules[0]; } Sdk sdk = PythonSdkUtil.findPythonSdk(module); if (sdk != null) { VirtualFile homeDir = sdk.getHomeDirectory(); if (homeDir == null) { return null; } String path = PathUtil.getLocalPath(homeDir.getParent()); if (path != null) { return FileUtil.toSystemDependentName(path); } } return null; }