{"id":2277,"library":"screeninfo","title":"Screeninfo","description":"Screeninfo is a Python library designed to fetch the location and size of physical screens connected to a system. It supports various operating systems including MS Windows, MS Windows (Cygwin), GNU/Linux (via X11 with Xinerama and experimental DRM), and macOS (using AppKit). The current version is 0.8.1, released in September 2022, and while no explicit release cadence is stated, it remains actively maintained.","status":"active","version":"0.8.1","language":"en","source_language":"en","source_url":"https://github.com/rr-/screeninfo","tags":["monitor","screen","display","resolution","system-info"],"install":[{"cmd":"pip install screeninfo","lang":"bash","label":"Install latest version"}],"dependencies":[],"imports":[{"symbol":"get_monitors","correct":"from screeninfo import get_monitors"},{"symbol":"get_primary_monitor","correct":"from screeninfo import get_primary_monitor"},{"note":"Used to force a specific backend for monitor enumeration.","symbol":"Enumerator","correct":"from screeninfo import get_monitors, Enumerator"},{"note":"While 'Monitor' objects are returned by 'get_monitors', direct import is from screeninfo.common if needed for type hinting or inspection.","symbol":"Monitor","correct":"from screeninfo.common import Monitor"}],"quickstart":{"code":"from screeninfo import get_monitors, get_primary_monitor\n\nprint(\"Detected monitors:\")\nfor m in get_monitors():\n    print(f\"  Monitor(x={m.x}, y={m.y}, width={m.width}, height={m.height}, is_primary={m.is_primary}, name={m.name})\")\n\nprimary = get_primary_monitor()\nif primary:\n    print(f\"\\nPrimary monitor: Monitor(x={primary.x}, y={primary.y}, width={primary.width}, height={primary.height}, name={primary.name})\")\nelse:\n    print(\"\\nNo primary monitor detected.\")","lang":"python","description":"This quickstart code demonstrates how to retrieve information about all connected monitors and specifically the primary monitor using `screeninfo`."},"warnings":[{"fix":"Ensure display drivers are correctly installed and that the environment is compatible with one of the supported backends (X11 for Linux, AppKit for macOS, etc.). Forcing a specific enumerator (e.g., `get_monitors(Enumerator.OSX)`) might sometimes help, but often points to a deeper environmental issue.","message":"Users, especially on macOS or certain Linux desktop environments (like Wayland), may encounter `screeninfo.common.ScreenInfoError: No enumerators available`. This indicates the library could not detect a compatible display backend.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Users on less-tested platforms should be aware of this and be prepared to contribute or work around platform-specific issues. Check GitHub issues for known platform-specific problems.","message":"The maintainer explicitly states that they do not personally test on OSX or other environments, encouraging pull requests for these platforms. This may lead to slower support or platform-specific quirks being less promptly addressed.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Verify that your system's locale settings are correctly configured for UTF-8. If using Poetry for development, be aware that `poetry.dev-dependencies` is deprecated; ensure your `pyproject.toml` uses `poetry.group.dev.dependencies` if you are developing `screeninfo` or a project that uses it with `poetry`.","message":"Some users have reported `UnicodeDecodeError` during installation on certain Linux distributions (e.g., Arch Linux) when using poetry, potentially related to locale settings or poetry's deprecated `dev-dependencies` section.","severity":"gotcha","affected_versions":"0.8.1 and possibly earlier (installation process specific)"}],"env_vars":null,"last_verified":"2026-04-09T00:00:00.000Z","next_check":"2026-07-08T00:00:00.000Z"}