{"id":14433,"library":"arcade","title":"Python Arcade Library","description":"Arcade is an easy-to-learn Python library for creating 2D video games, designed for both beginning programmers and those seeking a straightforward framework. It is built on top of the Pyglet multimedia library and OpenGL for modern graphics and sound. The library is actively maintained and frequently updated, with recent major versions introducing significant API changes and performance enhancements.","status":"active","version":"3.3.2","language":"en","source_language":"en","source_url":"https://github.com/pythonarcade/arcade","tags":["game-development","2d-graphics","education","pyglet","opengl"],"install":[{"cmd":"pip install arcade","lang":"bash","label":"Install stable version"},{"cmd":"pip install --pre arcade","lang":"bash","label":"Install pre-release/development version"}],"dependencies":[{"reason":"Core windowing and multimedia backend, including OpenGL bindings.","package":"pyglet"},{"reason":"Used for image loading, manipulation, and texture processing.","package":"Pillow"},{"reason":"Optional dependency for 2D physics engine integration.","package":"pymunk"}],"imports":[{"symbol":"arcade","correct":"import arcade"},{"note":"While 'from arcade import Window' works, the idiomatic and often safer way for Arcade classes is to use 'arcade.Window' to avoid name collisions and maintain clarity, especially for beginners.","wrong":"from arcade import Window\nclass MyGame(Window): ...","symbol":"Window","correct":"import arcade\nclass MyGame(arcade.Window): ..."}],"quickstart":{"code":"import arcade\n\nSCREEN_WIDTH = 800\nSCREEN_HEIGHT = 600\nSCREEN_TITLE = \"My Arcade Game\"\n\nclass MyGame(arcade.Window):\n    def __init__(self):\n        super().__init__(SCREEN_WIDTH, SCREEN_HEIGHT, SCREEN_TITLE)\n        arcade.set_background_color(arcade.color.AMAZON)\n\n    def on_draw(self):\n        self.clear()\n        arcade.draw_circle_filled(100, 100, 50, arcade.color.RED)\n\ndef main():\n    game = MyGame()\n    arcade.run()\n\nif __name__ == \"__main__\":\n    main()","lang":"python","description":"This quickstart code initializes an Arcade window with a specified size and title, sets a background color, and then draws a red filled circle in the `on_draw` method. The `arcade.run()` call starts the game loop."},"warnings":[{"fix":"Consult the official migration guide for 3.x if upgrading from 2.x. Update code to use new `Sprite` methods (e.g., `update()` for logic), new drawing primitives (e.g., `arcade.gui` for UI components), and revised camera logic.","message":"Arcade 3.x introduced significant breaking changes compared to 2.x, especially in GUI, Sprite, and drawing APIs. Key changes include removal of `Sprite.draw()`, `Sprite.on_update()` (now unified `update`), and `Sprite.set_position()`. The `arcade.draw` module was restructured into submodules.","severity":"breaking","affected_versions":"3.0.0 and later"},{"fix":"Ensure your system's graphics drivers and hardware meet OpenGL 3.3+ requirements. For Linux, X11 is generally recommended over Wayland for best compatibility.","message":"Arcade requires OpenGL 3.3+ support, which means it will not run on environments like Raspberry Pi or Wayland without specific (and often complex) workarounds or hardware acceleration.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Avoid manipulating OpenGL-related objects (like `arcade.gl.Texture`, `arcade.gl.Buffer`) from background threads. If using threads, ensure any OpenGL object creation/destruction happens on the main thread, or manage OpenGL garbage collection explicitly using `gc_mode='context_gc'` when creating `arcade.Window` and calling `ctx.gc()` manually.","message":"Direct interaction with OpenGL objects (e.g., creating textures or buffers) from non-main threads can lead to errors, as OpenGL is not thread-safe. Python's garbage collector can sometimes trigger OpenGL object releases from other threads.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Replace calls to `arcade.quick_run()` with the standard `arcade.run()` function within an `arcade.Window` class structure, as shown in the quickstart example.","message":"The `arcade.quick_run` function was removed as it had no useful purpose and encouraged less structured code.","severity":"deprecated","affected_versions":"2.6.13 and later"}],"env_vars":null,"last_verified":"2026-04-16T00:00:00.000Z","next_check":"2026-07-15T00:00:00.000Z","problems":[{"fix":"Install 'Desktop development with C++' workload from Visual Studio Installer (Community edition is free), or specifically install 'Microsoft C++ Build Tools' from `https://visualstudio.microsoft.com/visual-cpp-build-tools/`.","cause":"This error occurs on Windows when `pip install arcade` attempts to compile a dependency (like `pymunk`) from source, and the necessary C++ build tools are missing.","error":"error: Microsoft Visual C++ 14.0 or greater is required. Get it with \"Microsoft C++ Build Tools\""},{"fix":"Ensure you are using the correct object-oriented pattern, typically by subclassing `arcade.Window` or `arcade.View` for game states. If you're looking for a Scene *manager*, it's often built around `arcade.View` transitions.","cause":"Users attempting to directly import `Scene` or other core classes that are meant to be inherited from `arcade.Window` or `arcade.View` (or were part of internal restructuring).","error":"AttributeError: module 'arcade' has no attribute 'Scene'"},{"fix":"Activate your Python virtual environment (if using one). Re-run `pip install arcade` to ensure the library is correctly installed. Verify installation by running `python -c \"import arcade; print(arcade.__version__)\"`.","cause":"The `arcade` command (used to get environment info or run examples) or Python interpreter cannot find the installed `arcade` package. This often happens if a virtual environment is not activated or `arcade` was not installed successfully in the current environment.","error":"bash: arcade: command not found"},{"fix":"Ensure `arcade.open_window()` is called or an `arcade.Window` subclass is instantiated and `arcade.run()` is invoked before attempting drawing or other context-dependent operations. In object-oriented setup, ensure drawing/setup code runs within `__init__`, `setup()`, or `on_draw()` methods of your `arcade.Window` subclass.","cause":"An Arcade drawing or OpenGL-dependent function was called before an `arcade.Window` was created and made current. Many Arcade operations require an active OpenGL context.","error":"Window not created yet. Call `arcade.open_window()` or subclass `arcade.Window` before using this function."}],"ecosystem":"pypi"}