VirtualFile (@NotNull Module module) { final String requirementsPath = PyPackageRequirementsSettings.getInstance(module).getRequirementsPath(); if (!requirementsPath.isEmpty()) { final VirtualFile file = LocalFileSystem.getInstance().findFileByPath(requirementsPath); if (file != null) { return file; } final ModuleRootManager manager = ModuleRootManager.getInstance(module); for (VirtualFile root : manager.getContentRoots()) { final VirtualFile fileInRoot = root.findFileByRelativePath(requirementsPath); if (fileInRoot != null) { return fileInRoot; } } } return null; }