boolean (InstalledPackage pkg) { if (!myHasManagement) return false; final Sdk sdk = getSelectedSdk(); if (sdk == null) return false; if (!PyPackageUtil.packageManagementEnabled(sdk, false, false)) return false; if (PythonSdkUtil.isVirtualEnv(sdk) && pkg instanceof PyPackage) { final String location = ((PyPackage)pkg).getLocation(); if (location != null && location.startsWith(PythonSdkUtil.getUserSite())) { return false; } } final String name = pkg.getName(); if (PyPackageUtil.PIP.equals(name) || PyPackageUtil.SETUPTOOLS.equals(name) || PyPackageUtil.DISTRIBUTE.equals(name) || PyCondaPackageManagerImpl.PYTHON.equals(name)) { return false; } return true; }