{"id":23939,"library":"kivy-deps-sdl2","title":"Kivy SDL2 Dependency","description":"Repackaged binary dependency of Kivy providing SDL2 libraries. Version 0.8.0 is the latest release. Release cadence is irregular, tied to Kivy packaging updates.","status":"active","version":"0.8.0","language":"python","source_language":"en","source_url":"https://github.com/kivy/kivy-deps-sdl2","tags":["kivy","sdl2","binary-dependency","gui"],"install":[{"cmd":"pip install kivy-deps-sdl2","lang":"bash","label":"Install from PyPI"}],"dependencies":[],"imports":[{"note":"kivy-deps-sdl2 provides binary SDL2 libraries, not Python imports. Direct import of sdl2 is not supported; use Kivy's Window.","wrong":"import sdl2","symbol":"sdl2","correct":"from kivy.core.window import Window"}],"quickstart":{"code":"import kivy\nkivy.require('2.1.0')\nfrom kivy.app import App\nfrom kivy.uix.label import Label\n\nclass MyApp(App):\n    def build(self):\n        return Label(text='Hello, Kivy with SDL2')\n\nif __name__ == '__main__':\n    MyApp().run()","lang":"python","description":"Basic Kivy app that uses SDL2 as the window provider via kivy-deps-sdl2."},"warnings":[{"fix":"Install kivy-deps-sdl2 and use Kivy's Window class.","message":"kivy-deps-sdl2 is not imported directly; it only provides the SDL2 binaries. Attempting to import sdl2 will fail.","severity":"gotcha","affected_versions":"all"},{"fix":"Uninstall conflicting packages or use a virtual environment.","message":"Conflicts may arise if other SDL2 packages (like PySDL2) are installed. This package relies on a specific SDL2 version.","severity":"gotcha","affected_versions":"all"},{"fix":"Use Kivy's built-in dependencies when available.","message":"Kivy 2.2+ uses SDL2 by default; kivy-deps-sdl2 may become deprecated if Kivy bundles its own SDL2.","severity":"deprecated","affected_versions":">=0.8.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Do not import sdl2; instead use Kivy's core modules like from kivy.core.window import Window.","cause":"Trying to import sdl2 directly, but kivy-deps-sdl2 does not provide a Python module by that name.","error":"ImportError: No module named 'sdl2'"},{"fix":"Uninstall any other SDL2-related packages and ensure only kivy-deps-sdl2 is installed.","cause":"Conflicting SDL2 libraries from another package (e.g., PySDL2, pysdl2).","error":"OSError: incompatible library version"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}