{"id":28119,"library":"pyxel","title":"Pyxel","description":"A retro game engine for Python, designed for creating pixel-art games. Latest version: 2.9.5. Release cadence: irregular, major updates every few months.","status":"active","version":"2.9.5","language":"python","source_language":"en","source_url":"https://github.com/kitao/pyxel.git","tags":["retro","game engine","pixel art","game development"],"install":[{"cmd":"pip install pyxel","lang":"bash","label":"Install Pyxel"}],"dependencies":[],"imports":[{"note":"Wildcard imports discouraged; import pyxel then use pyxel.init(), etc.","wrong":"from pyxel import *","symbol":"pyxel","correct":"import pyxel"}],"quickstart":{"code":"import pyxel\n\npyxel.init(160, 120)\n\nclass App:\n    def __init__(self):\n        pyxel.run(self.update, self.draw)\n\n    def update(self):\n        if pyxel.btnp(pyxel.KEY_Q):\n            pyxel.quit()\n\n    def draw(self):\n        pyxel.cls(0)\n        pyxel.text(55, 41, \"Hello, Pyxel!\", 7)\n\nApp()","lang":"python","description":"Minimal Pyxel app with a window, update loop, and quit on Q."},"warnings":[{"fix":"Rewrite to use new API: `pyxel.init()` instead of `pyxel.init(width, height, caption)`, `pyxel.run()` instead of `pyxel.App().run()`, `pyxel.btnp()` instead of `pyxel.btn()` for press detection.","message":"Pyxel 2.0 introduced many breaking changes: API redesigned, removed old classes like `pyxel.App`, `pyxel.Image`, etc. Functions now use lower_case instead of camelCase.","severity":"breaking","affected_versions":"<2.0 (upgrade to 2.x)"},{"fix":"Grant Accessibility permission to the terminal (System Preferences → Security & Privacy → Privacy → Accessibility → add your terminal app).","message":"On macOS, Pyxel may fail to launch if the terminal doesn't have accessibility permissions. The window may appear but is unresponsive.","severity":"gotcha","affected_versions":"all"},{"fix":"Use `pyxel.colors.from_list(pyxel.COLORS_16)` to restore old palette, or adjust colors.","message":"Pyxel 2.2 changed the default palette from 16 colors to the PICO-8 palette. Existing projects may look different.","severity":"breaking","affected_versions":">=2.2"}],"env_vars":null,"last_verified":"2026-05-09T00:00:00.000Z","next_check":"2026-08-07T00:00:00.000Z","problems":[{"fix":"Install with `pip install pyxel` and ensure Python >=3.10.","cause":"Pyxel not installed or Python version <3.10.","error":"ModuleNotFoundError: No module named 'pyxel'"},{"fix":"Remove the caption argument: `pyxel.init(160, 120)` instead of `pyxel.init(160, 120, \"My Game\")`.","cause":"Old code passing caption as third argument; modern pyxel.init() only takes width, height.","error":"pyxel.init() takes 2 positional arguments but 3 were given"},{"fix":"Use `pyxel.run(update, draw)` inside a class or functions. See quickstart.","cause":"Old code using `pyxel.App` which was removed in 2.0.","error":"AttributeError: module 'pyxel' has no attribute 'App'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}