void (@NotNull final Project project) { final PyPackageManager manager = PyPackageManager.getInstance(mySdk); final List<PyPackage> packages = manager.getPackages(); if (packages == null) { return; } final List<PyRequirement> chosen; if (myUnsatisfied.size() > 1) { final PyChooseRequirementsDialog dialog = new PyChooseRequirementsDialog(project, myUnsatisfied); if (dialog.showAndGet()) { chosen = dialog.getMarkedElements(); } else { chosen = Collections.emptyList(); } } else { chosen = myUnsatisfied; } if (chosen.isEmpty()) { return; } boolean hasManagement; try { hasManagement = manager.hasManagement(); } catch (ExecutionException e) { hasManagement = false; } if (!hasManagement) { final PyPackageManagerUI ui = new PyPackageManagerUI(project, mySdk, new RunningPackagingTasksListener(myModule) { @Override public void finished(List<ExecutionException> exceptions) { super.finished(exceptions); if (exceptions.isEmpty()) { installRequirements(project, chosen); } } }); ui.installManagement(); } else { installRequirements(project, chosen); } }