{"record":{"id":"871b764ac8fd9341","repo":"soxoj/maigret","slug":"missing-required-dependency-while-starting-maigret","errorCode":null,"errorMessage":"Missing required dependency while starting Maigret.\n\nIf installed from PyPI:\n    pip install -U maigret\n\nIf running from a cloned repository:\n    pip install -e .\n\nThen run Maigret as:\n    python -m maigret <username>","messagePattern":"Missing required dependency while starting Maigret\\.\n\nIf installed from PyPI:\n    pip install -U maigret\n\nIf running from a cloned repository:\n    pip install -e \\.\n\nThen run Maigret as:\n    python -m maigret <username>","errorType":"exception","errorClass":"ImportError","httpStatus":null,"severity":"critical","filePath":"maigret/__init__.py","lineNumber":13,"sourceCode":"\"\"\"Maigret\"\"\"\n\n__title__ = 'Maigret'\n__package__ = 'maigret'\n__author__ = 'Soxoj'\n__author_email__ = 'soxoj@protonmail.com'\n\n\nfrom .__version__ import __version__\ntry:\n    from .checking import maigret as search\nexcept ImportError as e:\n    raise ImportError(\n        \"Missing required dependency while starting Maigret.\\n\\n\"\n        \"If installed from PyPI:\\n\"\n        \"    pip install -U maigret\\n\\n\"\n        \"If running from a cloned repository:\\n\"\n        \"    pip install -e .\\n\\n\"\n        \"Then run Maigret as:\\n\"\n        \"    python -m maigret <username>\"\n    ) from e\nfrom .maigret import main as cli\nfrom .sites import MaigretEngine, MaigretSite, MaigretDatabase\nfrom .notify import QueryNotifyPrint as Notifier\n","sourceCodeStart":1,"sourceCodeEnd":25,"githubUrl":"https://github.com/soxoj/maigret/blob/41674631a92a4c3ea630d046ba125cb750c03798/maigret/__init__.py#L1-L25","documentation":"Raised by maigret/__init__.py when `from .checking import maigret` fails with an ImportError, meaning Maigret's own runtime dependencies (or submodules) could not be imported. The package guards its top-level import so users get actionable install instructions instead of a raw internal traceback. It almost always means the package is being run from a source checkout without dependencies installed, or a broken/partial install.","triggerScenarios":"Importing `maigret` (e.g. `import maigret` or `python -m maigret`) when `maigret.checking` or one of its transitive imports (aiohttp, requests, etc.) is missing; running from a cloned repo without `pip install -e .`; a truncated/partial PyPI install; a Python version incompatible with a dependency causing import failure.","commonSituations":"Cloning the repo and running `python -m maigret` directly; stale virtualenv created before new dependencies were added in a recent release; system Python vs venv mismatch; installing with `--no-deps` or a broken pip cache.","solutions":["Run `pip install -U maigret` (PyPI install) or `pip install -e .` from the cloned repository root to (re)install dependencies.","Recreate/activate the correct virtualenv and reinstall: `python -m venv venv && source venv/bin/activate && pip install -e .`","Inspect the original ImportError chain (`raise ... from e`) to see which specific module is missing and `pip install` it.","If the install persists in failing, clear the pip cache / reinstall with `--force-reinstall`."],"exampleFix":"# before\npython -m maigret someuser\n# ImportError: Missing required dependency while starting Maigret...\n\n# after\npip install -e .\npython -m maigret someuser","handlingStrategy":"validation","validationCode":"import importlib.util, subprocess, sys\n\ndef ensure_maigret_importable():\n    if importlib.util.find_spec(\"maigret\") is None or importlib.util.find_spec(\"aiohttp\") is None:\n        subprocess.check_call([sys.executable, \"-m\", \"pip\", \"install\", \"-U\", \"maigret\"])","typeGuard":"def maigret_ready() -> bool:\n    try:\n        import maigret  # noqa: F401\n        return True\n    except ImportError:\n        return False","tryCatchPattern":"try:\n    import maigret\nexcept ImportError as e:\n    raise SystemExit(\n        \"maigret deps missing — run `pip install -U maigret` or `pip install -e .`\"\n    ) from e","preventionTips":["Pin maigret and its dependencies in requirements.txt / lockfile.","Install with `pip install -e .` from the repo root when developing against a checkout.","Recreate the virtualenv after upgrading maigret to a release that added new dependencies."],"tags":["python","installation","import-error","dependencies"],"backgroundTag":"missing-dependency","analyzedSha":"41674631a92a4c3ea630d046ba125cb750c03798","analyzedAt":"2026-08-27T02:53:58.946Z","schemaVersion":2},"datasetVersion":"2026-08-27T03:17:27.898Z"}