{"id":24301,"library":"pyboy","title":"PyBoy - Game Boy Emulator in Python","description":"PyBoy is a Game Boy and Game Boy Color emulator written in Python, version 2.7.0. It supports full emulation including CPU, memory, graphics, and sound, with a Python API for scripting and AI research. Release cadence: irregular, ~1-2 major versions per year.","status":"active","version":"2.7.0","language":"python","source_language":"en","source_url":"https://github.com/Baekalfen/PyBoy","tags":["emulator","gameboy","retro","gaming"],"install":[{"cmd":"pip install pyboy","lang":"bash","label":"PyPI install"}],"dependencies":[],"imports":[{"note":"direct import of module does not expose PyBoy class","wrong":"import pyboy","symbol":"PyBoy","correct":"from pyboy import PyBoy"},{"note":"PyBoyWindow was removed in 2.0.0, use PyBoy directly with window_type parameter","wrong":"from pyboy import PyBoyWindow","symbol":"PyBoyWindow","correct":"from pyboy import PyBoy"}],"quickstart":{"code":"from pyboy import PyBoy\n\n# Replace with path to a ROM file or None for no ROM\nrom_path = 'rom.gb'\npyboy = PyBoy(rom_path, window='null')\n\n# Run 100 frames (approx 1.6 seconds)\nfor _ in range(100):\n    pyboy.tick()\n\npyboy.stop()","lang":"python","description":"Initialize PyBoy with null window (headless) and run 100 frames."},"warnings":[{"fix":"Use `PyBoy(rom, window='null')` instead of `PyBoy(rom, window='SDL2')`. Do not use `with PyBoy(...):`.","message":"In version 2.0.0, the entire API was overhauled. `PyBoy` object is no longer a context manager; window_type parameter changed from 'SDL2' to 'display' or 'null'.","severity":"breaking","affected_versions":">=2.0.0"},{"fix":"Install SDL2 via `brew install sdl2` or use `window='null'`.","message":"PyBoy does not run on macOS with the default SDL2 display window due to missing SDL2 libraries. Use `window='null'` for headless or install SDL2 via Homebrew.","severity":"gotcha","affected_versions":"all"},{"fix":"Use `window='display'` or `window='null'` instead.","message":"The `PyBoyWindow` class is deprecated and removed in 2.0.0; window type is now an enum parameter.","severity":"deprecated","affected_versions":"<2.0.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Use `from pyboy import PyBoy`.","cause":"Incorrect import pattern. `import pyboy` does not expose the `PyBoy` class at top level.","error":"AttributeError: module 'pyboy' has no attribute 'PyBoy'"},{"fix":"Provide a valid path to a .gb or .gbc ROM file. For testing without a ROM, you can use `pyboy = PyBoy(None, window='null')` but note that may cause other issues.","cause":"Missing ROM file or incorrect path.","error":"FileNotFoundError: [Errno 2] No such file or directory: 'rom.gb'"},{"fix":"Use `window='display'` for a visible window, or `window='null'` for headless.","cause":"In version 2.0.0 and later, the window parameter no longer accepts 'SDL2' or 'OpenGL'.","error":"ValueError: Invalid window type: 'SDL2'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}