|
164 | 164 | " ok, version, msg = False, None, \"β docker compose is not available\"\n", |
165 | 165 | "print(msg)\n", |
166 | 166 | "\n", |
| 167 | + "# Check poppler-utils (required for PDF document processing)\n", |
| 168 | + "print(\"\\n\" + \"=\" * 60)\n", |
| 169 | + "print(\"π Checking system dependencies for document processing...\")\n", |
| 170 | + "ok, version, msg = check_command('pdfinfo')\n", |
| 171 | + "if ok:\n", |
| 172 | + " print(f\"β
{msg}\")\n", |
| 173 | + "else:\n", |
| 174 | + " print(f\"β οΈ {msg}\")\n", |
| 175 | + " print(\" poppler-utils is required for PDF document processing\")\n", |
| 176 | + " \n", |
| 177 | + " # Detect OS and provide installation instructions\n", |
| 178 | + " import platform\n", |
| 179 | + " system = platform.system().lower()\n", |
| 180 | + " \n", |
| 181 | + " if system == 'linux':\n", |
| 182 | + " print(\" π‘ To install on Ubuntu/Debian: sudo apt-get install poppler-utils\")\n", |
| 183 | + " print(\" π‘ To install on RHEL/CentOS: sudo yum install poppler-utils\")\n", |
| 184 | + " print(\" π‘ To install on Fedora: sudo dnf install poppler-utils\")\n", |
| 185 | + " \n", |
| 186 | + " # Try to detect package manager and offer automatic installation\n", |
| 187 | + " if shutil.which('apt-get'):\n", |
| 188 | + " try:\n", |
| 189 | + " install = input(\"\\nβ Would you like to install poppler-utils now? (requires sudo) [y/N]: \").strip().lower()\n", |
| 190 | + " if install == 'y':\n", |
| 191 | + " print(\"π¦ Installing poppler-utils...\")\n", |
| 192 | + " result = subprocess.run(\n", |
| 193 | + " ['sudo', 'apt-get', 'update'],\n", |
| 194 | + " capture_output=True,\n", |
| 195 | + " text=True,\n", |
| 196 | + " timeout=60\n", |
| 197 | + " )\n", |
| 198 | + " if result.returncode == 0:\n", |
| 199 | + " result = subprocess.run(\n", |
| 200 | + " ['sudo', 'apt-get', 'install', '-y', 'poppler-utils'],\n", |
| 201 | + " capture_output=True,\n", |
| 202 | + " text=True,\n", |
| 203 | + " timeout=120\n", |
| 204 | + " )\n", |
| 205 | + " if result.returncode == 0:\n", |
| 206 | + " print(\"β
poppler-utils installed successfully\")\n", |
| 207 | + " else:\n", |
| 208 | + " print(f\"β Installation failed: {result.stderr}\")\n", |
| 209 | + " else:\n", |
| 210 | + " print(f\"β Failed to update package list: {result.stderr}\")\n", |
| 211 | + " except (KeyboardInterrupt, EOFError):\n", |
| 212 | + " print(\"\\nβοΈ Skipping installation\")\n", |
| 213 | + " except Exception as e:\n", |
| 214 | + " print(f\"β οΈ Could not install automatically: {e}\")\n", |
| 215 | + " print(\" Please install manually: sudo apt-get install poppler-utils\")\n", |
| 216 | + " elif system == 'darwin': # macOS\n", |
| 217 | + " print(\" π‘ To install on macOS: brew install poppler\")\n", |
| 218 | + " if shutil.which('brew'):\n", |
| 219 | + " try:\n", |
| 220 | + " install = input(\"\\nβ Would you like to install poppler now? [y/N]: \").strip().lower()\n", |
| 221 | + " if install == 'y':\n", |
| 222 | + " print(\"π¦ Installing poppler...\")\n", |
| 223 | + " result = subprocess.run(\n", |
| 224 | + " ['brew', 'install', 'poppler'],\n", |
| 225 | + " capture_output=True,\n", |
| 226 | + " text=True,\n", |
| 227 | + " timeout=300\n", |
| 228 | + " )\n", |
| 229 | + " if result.returncode == 0:\n", |
| 230 | + " print(\"β
poppler installed successfully\")\n", |
| 231 | + " else:\n", |
| 232 | + " print(f\"β Installation failed: {result.stderr}\")\n", |
| 233 | + " except (KeyboardInterrupt, EOFError):\n", |
| 234 | + " print(\"\\nβοΈ Skipping installation\")\n", |
| 235 | + " except Exception as e:\n", |
| 236 | + " print(f\"β οΈ Could not install automatically: {e}\")\n", |
| 237 | + " print(\" Please install manually: brew install poppler\")\n", |
| 238 | + " else:\n", |
| 239 | + " print(\" π‘ Please install poppler-utils using your system's package manager\")\n", |
| 240 | + " print(\" π‘ Windows: Download from http://blog.alivate.com.au/poppler-windows/\")\n", |
| 241 | + "\n", |
167 | 242 | "print(\"\\n\" + \"=\" * 60)\n", |
168 | 243 | "print(\"\\nβ
Prerequisites check complete!\")\n", |
169 | 244 | "print(\"\\nπ If any checks failed, please install the missing tools before proceeding.\")\n" |
|
0 commit comments